-
-
Notifications
You must be signed in to change notification settings - Fork 860
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
[BUG] unbounded horizontal scroll breaks most tile grids #1976
Comments
( @monsieurtanuki ) |
@arneke Indeed, what I know about GIS is limited to
Which of my assumptions is wrong in your case? With your help, I'd be able to make both systems work - webmercator and more exotic ones. Possibly with a flag. I'll have a look at your example and see what happens. |
Thanks for responding 👍 Unfortunately it gets a bit more complicated. Resolutions where you divide by two are common, but there are also grids where each matrix corresponds to 1:1000, 1:2000, 1:2500 , etc, to match old requirements. And to be fair, there is quite a bit of code in flutter_map that makes this confusing. (The projection has to be the same for all layers, but each layer should actually have a separate set of resolutions and origins, so that tile boundaries from different sources do not have to align perfectly) You can have a look at https://www.trafikverket.se/trafikinformation/vag/ , the web client illustrates that you cannot zoom out to a single tile, z = 0 is actually 6 x 10 tiles (approximately). The tilematrix is described in To be honest, I think you should only do this for webmercator, revert to the old behavior for all others. Will cover 90% of the use cases and not break anything. |
@arneke Looking back at the code, hopefully it won't be hard to fix (?) because I only added a couple of new classes. |
@arneke Good news - in a first approach - I've managed to roll back my changes in only 5 files.
That doesn't mean that the implementation for both systems is done yet ;) |
nice 👏 |
@arneke I think I'll PR tomorrow. |
@arneke I'm about to PR. |
No, as written in the comment, that one is a bit encumbered, would not make it "official". https://demo.fleaflet.dev/crs_epsg4326 appears to be broken on master, but it's not a very general case. I can look tonight for a better example |
Thank you, that would be perfect: just find the easiest / most stupid example you can, that doesn't work with the master but works with 7.0.2. |
I have updated the example above with one I believe is ok to add to the repo. Comment above, origin and urlTemplate have been replaced. |
If you make the branch you are working on public somewhere, I'd be happy to test it. (Waiting for this issue to be resolved before I can deploy a new version of my own app.) |
What is the bug?
My EPSG:3006 WMTS layer works in 7.0.2, but stopped working after I switched to the master branch. On closer inspection, the reason was that flutter_map is requesting the wrong x,y,z tiles for a given lat,long position.
I've not completely isolated #1948 as the cause, but I think it's the most likely thing in the commit log, and there is an assumption about the modulus that is not generally true.
How can we reproduce it?
Most non-WebMercator grids should trigger this, but here is one.
Do you have a potential solution?
I don't uderstand all the code in #1948 , but I believe the problem originates in
final modulo = 1 << coordinates.z;
flutter_map/lib/src/layer/tile_layer/tile_coordinates.dart
Line 28 in d73d2f1
I don't think the code currently handles cases where
In general, I think you need a flag on the CRS to know whether unbounded scroll applies. Or only enable it for WebMercator for now.
Platforms
All
Severity
Obtrusive: Prevents normal functioning but causes no errors in the console
The text was updated successfully, but these errors were encountered: