LayerRegistry class

Objects contributed by every layer of one map, grouped by kind and keyed by layer id.

Layers call set… whenever their objects change; the map flushes the merged state to the platform as a diff, once per frame. Object ids are '<layerId>/<key-or-index>', so a marker tap is routed back to the layer by its id prefix.

Layers stack like flutter_map's: in the order of UnifiedMap.children (layers under the same child in the order they were mounted). Each layer gets an integer z-index; when a layer is inserted below others, the layers whose z-index changes are synced again.

Updates of each kind reach the platform one at a time: a push waits for the previous one of its kind to complete, and the changes made meanwhile go out as a single diff. A diff is recorded as sent only once applied; a failed update is reported, sent again once right away, then with the next change. A transition only animates the markers of the layers that asked for one: the markers of the other layers go out first in an update without transition. Polylines, polygons and circles that change in the same frame as markers are sent once that marker update is applied, so a layer's shapes and markers reach the map together; shapes are never animated.

Properties

circles → Map<String, PlatformCircle>
no setter
flutterMapLayers → List<Widget>
Every layer's flutter_map layer widgets, bottom layer first. Keyed by layer id and position so that a stateful flutter_map layer keeps its state when another layer is added or removed before it.
no setter
hashCode → int
The hash code for this object.
no setterinherited
markers → Map<String, PlatformMarker>
no setter
onChanged → void Function()
final
polygons → Map<String, PlatformPolygon>
no setter
polylines → Map<String, PlatformPolyline>
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tileLayers → Map<String, PlatformTileLayer>
no setter

Methods

hasLayer(String layerId) → bool
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeLayer(String layerId) → void
setCircles(String layerId, List<PlatformCircle> circles) → void
setFlutterMapLayers(String layerId, List<Widget> layers) → void
flutter_map layer widgets of layerId, drawn inside the map by platforms that draw it with flutter_map (UnifiedMapsPlatform.supportsFlutterMapLayers) and ignored by the others.
setHitTester(String layerId, LayerHitTester? tester) → void
setMarkers(String layerId, List<PlatformMarker> markers, {MarkerTapHandler? onTap, MarkerTransition? transition}) → void
Replaces the markers of layerId. transition animates this layer's markers in the next marker push (the other layers' markers are not animated); transitions set before that push are merged, and only the entries of markers that the push really adds or removes are sent.
setPolygons(String layerId, List<PlatformPolygon> polygons) → void
setPolylines(String layerId, List<PlatformPolyline> polylines) → void
setTileLayers(String layerId, List<PlatformTileLayer> tileLayers) → void
shapeZIndexOf(String layerId, int index, int count) → double
z-index of the index-th of count shapes of a layer. flutter_map paints a layer's shapes in list order; native maps only order by z-index, so later shapes get a slightly higher one. The spread stays below 0.4 so a shape never rises above the next layer, nor above the borders (zIndex - 0.5) drawn for that layer.
toString() → String
A string representation of this object.
inherited
zIndexOf(String layerId) → double
z-index of a registered layer: an integer, higher for layers later in UnifiedMap.children.

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

newLayerId() → String
platformCurve(Curve curve) → PlatformCurve
curve for the platforms: a Cubic as is, any other curve sampled at evenly spaced times.