Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
TileLayer layers
(I.
,II.
,III.
) and if I swapII.
andIII. widget layers
thennew II. layer
will have theold II. layer's state
andnew III. layer
will have theold 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.flutter_map_state.dart
thelayerStack
may move around in widget tree which causes for statefull layers (forinstanceTileLayer
) to fully loose their states, this happens if map isrotated
and/orintercative property changes
so GlobalKey needed.