Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set the display boundary #1190

Closed
SanSanNiang opened this issue Mar 18, 2022 · 16 comments
Closed

How to set the display boundary #1190

SanSanNiang opened this issue Mar 18, 2022 · 16 comments
Labels
feature This issue requests a new feature

Comments

@SanSanNiang
Copy link

How to set the display boundary ?
Only the set area is displayed, and beyond the boundary can not be dragged

@SanSanNiang SanSanNiang added bug This issue reports broken functionality or another error needs triage This new bug report needs reproducing and prioritizing labels Mar 18, 2022
@JaffaKetchup
Copy link
Member

@SanSanNiang Hi there,
Sorry, I don't quite understand your request? Can you explain more information. Many thanks.

@JaffaKetchup JaffaKetchup added question/help and removed bug This issue reports broken functionality or another error needs triage This new bug report needs reproducing and prioritizing labels Mar 20, 2022
@SanSanNiang
Copy link
Author

SanSanNiang commented Mar 21, 2022

@SanSanNiang Hi there, Sorry, I don't quite understand your request? Can you explain more information. Many thanks.

I tested a map, based on Epsg3857,which displays part of the map.
Now, the map shows the exceeding part, and the exceeding part is gray. What should I do not display the exceeding part?
微信图片_20220321085212

@JaffaKetchup
Copy link
Member

Ok, related to #1103 perhaps?

@JaffaKetchup
Copy link
Member

I can't help fully, as I've never dealt with it before, but you should be able to set bounds in MapOptions? Please try that or look at the issue linked above, and let me know if it works.

@SanSanNiang
Copy link
Author

I can't help fully, as I've never dealt with it before, but you should be able to set bounds in MapOptions? Please try that or look at the issue linked above, and let me know if it works.

With the sw and ne coordinates of the map as the boundary, although there are restrictions on dragging, there are still excess parts displayed.
微信图片_20220322161401
微信图片_20220322161418

@sam-parks
Copy link

sam-parks commented Mar 22, 2022

I'm also experiencing this issue:

Screen Shot 2022-03-22 at 9 08 44 AM

@JaffaKetchup
Copy link
Member

@sam-parks Can you say which version/commit this problem appeared in, or have you just started using it?

@JaffaKetchup
Copy link
Member

Can you both please write a minimal reproducible example for me to test and experiment with? Many thanks.

@JaffaKetchup JaffaKetchup added bug This issue reports broken functionality or another error non-fatal and removed question/help labels Mar 22, 2022
@sam-parks
Copy link

@JaffaKetchup

I did just start using the package so its version 0.14.0

FlutterMap(
                options: MapOptions(
                  zoom: 2,
                  maxZoom: 7,
                  minZoom: 2,
                  center: LatLng(15.96, 45.81),
                ),
                children: <Widget>[
                  TileLayerWidget(
                    options: TileLayerOptions(
                      urlTemplate:
                          'https://api.maptiler.com/maps/bright/{z}/{x}/{y}.png?key=FHzUbZwstZKBiAQE7D4V',
                    ),
                  ),

@SanSanNiang
Copy link
Author

Can you both please write a minimal reproducible example for me to test and experiment with? Many thanks.

the package version:0.11.0
FlutterMap(
mapController: this._mapController,
options: MapOptions(
center: LatLng(39.813363,124.143537),
interactiveFlags: InteractiveFlag.all &
~InteractiveFlag.rotate, // Disable map rotation
slideOnBoundaries: true,
swPanBoundary:LatLng(39.743098,124.093323),
nePanBoundary: LatLng(39.861238,124.197371),
minZoom: 12.0,
maxZoom: 14.0,
zoom: 13,

                      ),
                      layers: [
                        TileLayerOptions(
                          maxZoom: 14.0,
                          wmsOptions: WMSTileLayerOptions(
                              baseUrl:
                                  'http://124.93.251.50:8085/geoserver/dandongport/wms?',
                              layers: ['dandongport:dandongport_tile'],
                              version: '1.1.1',
                              ),
                        ),
                      
                      ],
                    ),

@JaffaKetchup
Copy link
Member

JaffaKetchup commented Mar 24, 2022

Please update to the latest version 0.14.0 if you can. If not use advanced installation to use the latest commits from this package on branch 'master'. Support is limited for older versions, due to high maintenance pressures at the moment.

@sam-parks I'm not familiar with these options, but the bounds and boundsOptions parameters (in MapOptions()) might work better for you? Please try and get back to me.

@sam-parks
Copy link

@JaffaKetchup I tried messing around with bounds and boundsOptions but that only seems to change the bounds of the initial position. I can still scroll to the grey areas.

@JaffaKetchup
Copy link
Member

In that case I will need to investigate further. Many thanks for your help!

@stx
Copy link

stx commented Apr 2, 2022

Same issue here using Mapbox tiles (not sure it matters though.)

Setting panBoundaries doesn't seem to affect it - at least vertically.

@stx
Copy link

stx commented Apr 3, 2022

For @JaffaKetchup or whoever else is interested, I created a $100 bounty for a nice and timely fix for this for mobile and web. Source

@JaffaKetchup JaffaKetchup added help wanted feature This issue requests a new feature labels Apr 4, 2022
@stx
Copy link

stx commented Apr 11, 2022

This looks fixed by PR #1211 and I think we can close it now for the bounty. Thank you @ibrierley!

@JaffaKetchup JaffaKetchup removed bug This issue reports broken functionality or another error help wanted labels Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This issue requests a new feature
Projects
None yet
Development

No branches or pull requests

4 participants