Skip to content

Key management#695

Merged
johnpryan merged 4 commits intofleaflet:masterfrom
maRci002:feature/key_management
Aug 4, 2020
Merged

Key management#695
johnpryan merged 4 commits intofleaflet:masterfrom
maRci002:feature/key_management

Conversation

@maRci002
Copy link
Copy Markdown
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