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

Key management #695

Merged
merged 4 commits into from
Aug 4, 2020
Merged

Conversation

maRci002
Copy link
Contributor

This PR adds some key management feature for this project.
Basicly keys preserve state when widgets move around in the widget tree.

There was two problems:

  1. If I have forexample 3 TileLayer layers (I., II., III.) and if I swap II. and III. widget layers then new II. layer will have the old II. layer's state and new III. layer will have the old III. layer's state => so the loaded _tiles which are stored in state will have a hard time because it will show old tiles and panning will load new ones. If no keys provided then Observe TileLayerOptions changes #584 PR will think url has been changed so the wrong _tiles will we reloaded, however this can avoided by using keys. This may happen forinstance if you want swap two wms layers.
  2. In flutter_map_state.dart the layerStack may move around in widget tree which causes for statefull layers (forinstance TileLayer) to fully loose their states, this happens if map is rotated and/or intercative property changes so GlobalKey needed.

@johnpryan johnpryan merged commit 265e293 into fleaflet:master Aug 4, 2020
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

Successfully merging this pull request may close these issues.

2 participants