MarkerByItemDataStore class

Holds a collection of markers. Marker could mark a POI (e.g. restaurants) or ways (e.g. special interest areas). Use this class if you often access the markers by their item. This is the case if you want to change the rendering of the marker.

Inheritance

Constructors

MarkerByItemDataStore({int extendMeters = 5000})

Properties

disposed bool
no setterinherited
extendMeters int
how large to extend a bounding area. When retrieving markers we extend the bounding area a bit. By doing so we retrieve a bit more markers than actually needed right now but we do not need to retrieve markers again as long as the view does not extend the extended bounding area by moving the map outside. This saves cpu. Measurements in meters.
final
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
addMarker(Marker marker) → void
Adds a new marker. Note that you may need to call setRepaint() afterwards. It is not called automatically because often we want to modify many markers at once without repainting after every modification.
clearMarkers() → void
Do not forget to call setRepaint()
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
override
getAllItems() Iterable
getMarkersToPaint(BoundingBox boundary, int zoomLevel) List<Marker>
returns the markers to draw for the given boundary. If this method needs more time return an empty list and call setRepaint() when finished.
override
getMarkerWithItem(dynamic item) Marker?
isTapped(TapEvent tapEvent) List<Marker>
called if the user taps at the screen. The method will return a list of markers which are considered as "tapped by the user"
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
https://stackoverflow.com/questions/63884633/unhandled-exception-a-changenotifier-was-used-after-being-disposed
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
removeMarker(Marker marker) → void
Do not forget to call setRepaint()
removeMarkerWithItem(dynamic item) → void
remove the marker with the given item. Do not forget to call setRepaint()
replaceMarker(dynamic item, BasicMarker newMarker) → void
Finds the old marker with the given item and replaces it with the new marker. Do not forget to call setRepaint()
retrieveMarkersFor(BoundingBox boundary, int zoomLevel) → void
This method will be called if boundary or zoomlevel changes to give the implementation the chance to replace/retrieve markers for the new boundary/zoomlevel. If this method changes something asynchronously it must call setRepaint afterwards.
setRepaint() → void
Triggers a repaint of the markers for this datastore
inherited
toString() String
A string representation of this object.
inherited

Operators

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