Creating New Layers
Creating a new map layer is a great way to achieve a more custom, performant, map design. For example, it might be used to display a scale bar, or overlay a grid.
Check the Plugins List for layers that already implement the behaviour you wish to replicate.
1. Creating A Layer Widget
2. Hooking Into Inherited State
Then, there are three possible methods that could be used to retrieve separate 'aspects' of the state of the map.
Calling these inside a build
method will also cause the layer to rebuild automatically when the depended-on aspects change.
Using these methods will restrict this widget to only being usable inside the context of a FlutterMap
.