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

Map view removes tiles when zooming to new zoom levels #2

Closed
chances opened this issue Feb 6, 2018 · 2 comments
Closed

Map view removes tiles when zooming to new zoom levels #2

chances opened this issue Feb 6, 2018 · 2 comments

Comments

@chances
Copy link

chances commented Feb 6, 2018

Steps to reproduce:

  1. Run example
  2. Let default map view tiles load
  3. Pinch to zoom into the map at a new zoom level
  4. Observe the previously loaded tiles disappear
  5. Wait for new tiles to load
  6. Observe new tiles fade in

This experience is jarring and can prevent me from seeing what I'm zooming into.

This issue can also be reproduced by zooming out from the initial map location to other zoom levels.

Instead the tiles should render as they do in Mapbox's Raster tile source example. The old tiles remain rendered and are scaled to the current zoom level. New tiles at different zoom levels then fade in on top of the old tiles.

@johnpryan
Copy link
Collaborator

johnpryan commented Feb 7, 2018

_TileLayerState doesn't support multiple "levels" properly yet.

Currently, _TileLayerState calls _setView every time build() is called (https://github.com/apptreesoftware/flutter_map/blob/master/flutter_map/lib/src/layer/tile_layer.dart#L256) which causes the rest of the build method to only render the tiles that are at the current _tileZoom.

Leaflet uses a cache of each HTML elements to store tiles, which in Flutter, is just a cache of Tile objects, but I haven't quite figured out how Leaflet cleans up old tiles (tiles not at the current z-index). So the solution here could be to always render all tiles in the cache, regardless of z-index, and set a timer to remove them from the cache when the z-index changes.

@johnpryan
Copy link
Collaborator

johnpryan commented Feb 21, 2018

this is resolved by https://github.com/apptreesoftware/flutter_map/pull/5 - Like leaflet, we clear the tiles if the zoom level differs by more than a certain amount, but in general the image widgets should now remain on the screen when the zoom level changes.

@dyardyGIT dyardyGIT mentioned this issue Feb 5, 2019
juliano-souza000 pushed a commit to juliano-souza000/flutter_map that referenced this issue Mar 26, 2023
* Ignore pubspec.lock

* Migrate to null-safety

* Add changelog and bump version

* Update CHANGELOG.md

* Update README.md

* Update pubspec.yaml

* Fix last random things

Co-authored-by: Luka S <[email protected]>
josxha added a commit that referenced this issue Jan 23, 2024
add polymorthism to gesture services
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants