Loading...
Searching...
No Matches
ClusterMapObject Class Referenceabstract

Runtime snapshot of a visible icon cluster on the location view. More...

+ Inheritance diagram for ClusterMapObject:

Public Member Functions

bool setBitmap (ImageProvider bitmap)
 Method is used to specify the decoded raster for the cluster marker.
 
void addListener (ClusterMapObjectListener listener)
 Adds a listener for cluster state updates ClusterMapObjectListener.
 
void removeListener (ClusterMapObjectListener listener)
 Removes a previously added listener.
 
int getId ()
 Gets the unique identifier of the map object.
 
MapObjectType getType ()
 Gets the type of the map object.
 
Uint8List getData ()
 Gets the user-defined data associated with the map object.
 
bool setVisible (bool visible)
 Method is used to specify the visibility of the map object.
 
bool setInteractive (bool interactive)
 Method is used to specify whether the map object can be interacted with.
 
void setData (Uint8List data)
 Method is used to set user-defined data for the map object.
 
bool setTitle (String title)
 Method is used to set the title of the map object.
 
bool setAlpha (double alpha)
 Method is used to set the opacity of the map object.
 

Public Attributes

LocationPoint get position
 Cluster center in metrics coordinates.
 
int get count
 Number of icon map objects in the cluster (at least 2 while the cluster is visible).
 
List< IconMapObject > get iconMapObjects
 Icon map objects currently grouped into this cluster.
 

Detailed Description

Runtime snapshot of a visible icon cluster on the location view.

Created and updated by ClusterMapObjectController. Member IconMapObject instances are hidden while grouped; the cluster marker is shown instead.

Note
Position and membership are managed by the controller and cannot be changed through this interface. Use ClusterMapObjectListener (onClusterChanged) to refresh a custom cluster bitmap when the member count changes.

Definition at line 31 of file cluster_map_object.dart.

Member Function Documentation

◆ addListener()

void ClusterMapObject.addListener ( ClusterMapObjectListener listener)

Adds a listener for cluster state updates ClusterMapObjectListener.

Parameters
listenerListener instance.

Dart code snippet:

cluster.addListener(_clusterChangeListener);
print('Added cluster change listener, initial count: ${cluster.count}');

◆ getData()

Uint8List MapObject.getData ( )
inherited

Gets the user-defined data associated with the map object.

Returns
The data stored in the map object.

Dart code snippet:

// Get custom data
Map<String, dynamic> retrievedData = _circleMapObject!.data;
print("Circle custom data: $retrievedData");

◆ getId()

int MapObject.getId ( )
inherited

Gets the unique identifier of the map object.

Returns
The unique identifier of the map object.

Dart code snippet:

// Get object ID
int objectId = _circleMapObject!.id;
print("Circle object ID: $objectId");

◆ getType()

MapObjectType MapObject.getType ( )
inherited

Gets the type of the map object.

Returns
The type of the map object MapObjectType.

Dart code snippet:

// Get object type
String objectTypeString = _circleMapObject!.type;
print("Circle object type: $objectTypeString");

◆ removeListener()

void ClusterMapObject.removeListener ( ClusterMapObjectListener listener)

Removes a previously added listener.

Parameters
listenerListener instance to remove.

Dart code snippet:

cluster.removeListener(_clusterChangeListener);
print('Removed cluster change listener');

◆ setAlpha()

bool MapObject.setAlpha ( double alpha)
inherited

Method is used to set the opacity of the map object.

Parameters
alphaOpacity multiplier. Values below 0 will be set to 0. Values above 1 will be set to 1. Default: 1.
Returns
true if the operation is successful, false otherwise.

Dart code snippet:

// Set alpha transparency
bool alphaSuccess = _circleMapObject!.setAlpha(0.7);
print("Set circle alpha to 0.7: $alphaSuccess");

◆ setBitmap()

bool ClusterMapObject.setBitmap ( ImageProvider bitmap)

Method is used to specify the decoded raster for the cluster marker.

Parameters
bitmapImage provider: Android com.navigine.image.ImageProvider; iOS UIImage via binding; Flutter navigine_sdk ImageProvider.
Returns
true if the operation is successful, false otherwise.

Dart code snippet:

final clusterBitmap = ImageProvider.fromFile("/path/to/cluster.png");
final bitmapSuccess = cluster.setBitmap(clusterBitmap);
print("Set cluster bitmap from ImageProvider: $bitmapSuccess");

◆ setData()

void MapObject.setData ( Uint8List data)
inherited

Method is used to set user-defined data for the map object.

Parameters
dataData to store in the map object.

Dart code snippet:

// Set custom data
Map<String, dynamic> customData = {"key": "value", "number": 42};
bool dataSuccess = _circleMapObject!.setData(customData);
print("Set circle custom data: $dataSuccess");

◆ setInteractive()

bool MapObject.setInteractive ( bool interactive)
inherited

Method is used to specify whether the map object can be interacted with.

Parameters
interactiveSpecifies whether the object can be picked in the pickMapObjectAt method (true) or not (false). Default: false.
Returns
true if the operation is successful, false otherwise.

Dart code snippet:

// Set interactive mode
bool interactiveSuccess = _circleMapObject!.setInteractive(true);
print("Set circle interactive to true: $interactiveSuccess");

◆ setTitle()

bool MapObject.setTitle ( String title)
inherited

Method is used to set the title of the map object.

Parameters
titleThe title to display on the location view.
Returns
true if the operation is successful, false otherwise.

Dart code snippet:

// Set title
bool titleSuccess = _circleMapObject!.setTitle("Circle Object");
print("Set circle title to 'Circle Object': $titleSuccess");

◆ setVisible()

bool MapObject.setVisible ( bool visible)
inherited

Method is used to specify the visibility of the map object.

Parameters
visibleSpecifies whether the object is visible (true) or hidden (false). Default: true.
Returns
true if the operation is successful, false otherwise.

Dart code snippet:

// Set visibility
bool visibleSuccess = _circleMapObject!.setVisible(true);
print("Set circle visibility to true: $visibleSuccess");

Member Data Documentation

◆ count

int get ClusterMapObject.count

Number of icon map objects in the cluster (at least 2 while the cluster is visible).

Definition at line 82 of file cluster_map_object.dart.

◆ iconMapObjects

List<IconMapObject> get ClusterMapObject.iconMapObjects

Icon map objects currently grouped into this cluster.

Definition at line 87 of file cluster_map_object.dart.

◆ position

LocationPoint get ClusterMapObject.position

Cluster center in metrics coordinates.

Definition at line 77 of file cluster_map_object.dart.


The documentation for this class was generated from the following file: