MapViewMarkerCollections class Maps & 3D Scenes

Manages collections of markers displayed on a map view.

MapViewMarkerCollections provides the entry point for adding, removing and querying collections of markers that are rendered on a GemMap.

Do not construct this class directly — obtain an instance from MapViewPreferences.markers. It also exposes access to the three singleton MarkerSketches collections (one per marker type) used for per-marker render settings.

Example:

final collection = MarkerCollection(markerType: MarkerType.point, name: 'POIs');
collection.add(Marker()..add(Coordinates(latitude: 52.0, longitude: 4.0)));
controller.preferences.markers.add(collection);

See also:

Properties

externalRenderers Map<int, ExternalRendererMarkers>
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
hasRegisteredAutoReleaseObject bool
getter/setter pairinherited
mapId int
no setter
pointerId int
The pointer ID of the native object
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size int
Number of marker collections currently managed by the map view.
no setter

Methods

add(MarkerCollection col, {MarkerCollectionRenderSettings? settings, ExternalRendererMarkers? externalRender}) → void
Add a marker collection to the map view.
addList({required List<MarkerWithRenderSettings> list, required MarkerCollectionRenderSettings settings, required String name, MarkerType markerType = MarkerType.point}) Future<List<int>>
Add a large list of markers to the map efficiently.
clear() Future<void>
Remove all marker collections from the map view.
contains(MarkerCollection col) bool
Returns whether col is currently present in this MapViewMarkerCollections.
dispose() → void
Disposes the native object.
inherited
getCollectionAt(int index) MarkerCollection
Retrieve the MarkerCollection at index.
getSketches(MarkerType type) MarkerSketches
Return the singleton MarkerSketches collection for a given type.
hitTest(Coordinates coordinates) List<MarkerMatch>
Perform a hit test across all marker collections at the given coordinates.
indexOf(MarkerCollection col) int
Return the index of col inside the map view collections.
isSketches(MarkerCollection coll) bool
Returns true when coll is one of the internal MarkerSketches collections.
load(Uint8List buffer) GemError
Restore marker collections from a previously serialized buffer.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerAutoReleaseObject(int pointerId) → void
Registers an object for auto release.
inherited
removeAt(int index) → void
Remove the collection at index from the map view.
save() Uint8List?
Serialize all marker collections to a binary buffer.
setRenderSettings(int index, MarkerCollectionRenderSettings settings) GemError
Apply render settings to the collection at index.
toString() String
A string representation of this object.
inherited

Operators

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