MarkerPublisher class

Publishes a layer's markers in atomic generations.

publish hands a whole generation of MarkerSpecs to the map at once, as soon as every one of its icons is rasterised. Until then the previous generation stays on the map untouched (no partial update, no gap), and a newer publish supersedes a generation still waiting for its icons. The generation's MarkerTransition and polylines go out with it. The publisher keeps the icons of the generation on the map, so a full icon cache never evicts an icon still on screen. An icon that fails to rasterise is reported and its markers are left out; it is tried again once a generation without it has been published.

Constructors

MarkerPublisher(String layerId)

Properties

hashCode → int
The hash code for this object.
no setterinherited
hasPending → bool
Whether a generation is waiting for its icons.
no setter
layerId → String
final
published → List<MarkerSpec>
The generation last handed to the map (markers whose icon failed are left out).
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
prepare(MapLayerHost host, Iterable<MarkerSpec> specs) → Future<void>
Rasterises the icons of specs ahead of time (into the map's icon cache) without publishing anything, so a later publish of them is immediate.
publish(MapLayerHost host, List<MarkerSpec> specs, {MarkerTapHandler? onTap, MarkerTransition? transition, List<Polyline<Object>>? polylines}) → void
Publishes specs as the layer's new generation. onTap receives the object id of a tapped marker of this generation; it replaces the previous handler when the generation reaches the map. polylines, when given, replace the layer's polylines (as MapLayerState.setPolylines) at the same time as the markers; when null the layer's polylines are left as they are.
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

anchorOf(Alignment alignment) → Offset