Loading...
Searching...
No Matches
com.navigine.idl.java.ClusterMapObject Class Referenceabstract

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

+ Inheritance diagram for com.navigine.idl.java.ClusterMapObject:

Public Member Functions

abstract boolean setBitmap (com.navigine.image.ImageProvider bitmap)
 Method is used to specify the decoded raster for the cluster marker.
 
abstract void addListener (ClusterMapObjectListener listener)
 Adds a listener for cluster state updates ClusterMapObjectListener.
 
abstract void removeListener (ClusterMapObjectListener listener)
 Removes a previously added listener.
 
abstract LocationPoint getPosition ()
 Cluster center in metrics coordinates.
 
abstract int getCount ()
 Number of icon map objects in the cluster (at least 2 while the cluster is visible).
 
abstract ArrayList< IconMapObjectgetIconMapObjects ()
 Icon map objects currently grouped into this cluster.
 
abstract int getId ()
 Gets the unique identifier of the map object.
 
abstract MapObjectType getType ()
 Gets the type of the map object.
 
abstract byte[] getData ()
 Gets the user-defined data associated with the map object.
 
abstract boolean setVisible (boolean visible)
 Method is used to specify the visibility of the map object.
 
abstract boolean setInteractive (boolean interactive)
 Method is used to specify whether the map object can be interacted with.
 
abstract void setData (byte[] data)
 Method is used to set user-defined data for the map object.
 
abstract boolean setTitle (String title)
 Method is used to set the title of the map object.
 
abstract boolean setAlpha (float alpha)
 Method is used to set the opacity of the map object.
 

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 23 of file ClusterMapObject.java.

Member Function Documentation

◆ addListener()

abstract void com.navigine.idl.java.ClusterMapObject.addListener ( ClusterMapObjectListener listener)
abstract

Adds a listener for cluster state updates ClusterMapObjectListener.

Parameters
listenerListener instance.

Java code snippet:

cluster.addListener(clusterChangeListener);
System.out.println("Added cluster change listener, initial count: " + cluster.getCount());

Kotlin code snippet:

cluster.addListener(clusterChangeListener)
println("Added cluster change listener, initial count: ${cluster.count}")

◆ getCount()

abstract int com.navigine.idl.java.ClusterMapObject.getCount ( )
abstract

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

Returns

◆ getData()

abstract byte[] com.navigine.idl.java.MapObject.getData ( )
abstractinherited

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

Returns
The data stored in the map object.

Java code snippet:

// Get custom data
Map<String, String> retrievedData = circleMapObject.getData();
System.out.println("Circle custom data: " + retrievedData);

Kotlin code snippet:

// Get custom data
val retrievedData = circleMapObject!!.data
println("Circle custom data: $retrievedData")

◆ getIconMapObjects()

abstract ArrayList< IconMapObject > com.navigine.idl.java.ClusterMapObject.getIconMapObjects ( )
abstract

Icon map objects currently grouped into this cluster.

Returns

◆ getId()

abstract int com.navigine.idl.java.MapObject.getId ( )
abstractinherited

Gets the unique identifier of the map object.

Returns
The unique identifier of the map object.

Java code snippet:

// Get object ID
int objectId = circleMapObject.getId();
System.out.println("Circle object ID: " + objectId);

Kotlin code snippet:

// Get object ID
val objectId = circleMapObject!!.id
println("Circle object ID: $objectId")

◆ getPosition()

abstract LocationPoint com.navigine.idl.java.ClusterMapObject.getPosition ( )
abstract

Cluster center in metrics coordinates.

Returns

◆ getType()

abstract MapObjectType com.navigine.idl.java.MapObject.getType ( )
abstractinherited

Gets the type of the map object.

Returns
The type of the map object MapObjectType.

Java code snippet:

// Get object type
String objectTypeString = circleMapObject.getType();
System.out.println("Circle object type: " + objectTypeString);

Kotlin code snippet:

// Get object type
val objectTypeString = circleMapObject!!.type
println("Circle object type: $objectTypeString")

◆ removeListener()

abstract void com.navigine.idl.java.ClusterMapObject.removeListener ( ClusterMapObjectListener listener)
abstract

Removes a previously added listener.

Parameters
listenerListener instance to remove.

Java code snippet:

activeCluster.removeListener(clusterChangeListener);
System.out.println("Removed cluster change listener");

Kotlin code snippet:

cluster.removeListener(clusterChangeListener)
println("Removed cluster change listener")

◆ setAlpha()

abstract boolean com.navigine.idl.java.MapObject.setAlpha ( float alpha)
abstractinherited

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.

Java code snippet:

// Set alpha transparency
boolean alphaSuccess = circleMapObject.setAlpha(0.7);
System.out.println("Set circle alpha to 0.7: " + alphaSuccess);

Kotlin code snippet:

// Set alpha transparency
val alphaSuccess = circleMapObject!!.setAlpha(0.7)
println("Set circle alpha to 0.7: $alphaSuccess")

◆ setBitmap()

abstract boolean com.navigine.idl.java.ClusterMapObject.setBitmap ( com.navigine.image.ImageProvider bitmap)
abstract

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.

Java code snippet:

ImageProvider clusterBitmap = ImageProvider.fromFile("/path/to/cluster.png", true);
boolean bitmapSuccess = cluster.setBitmap(clusterBitmap);
System.out.println("Set cluster bitmap from ImageProvider: " + bitmapSuccess);

Kotlin code snippet:

val clusterBitmap = ImageProvider.fromFile("/path/to/cluster.png", true)
val bitmapSuccess = cluster.setBitmap(clusterBitmap)
println("Set cluster bitmap from ImageProvider: $bitmapSuccess")

◆ setData()

abstract void com.navigine.idl.java.MapObject.setData ( byte[] data)
abstractinherited

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

Parameters
dataData to store in the map object.

Java code snippet:

// Set custom data
Map<String, String> customData = new HashMap<>();
customData.put("key", "value");
customData.put("number", "42");
boolean dataSuccess = circleMapObject.setData(customData);
System.out.println("Set circle custom data: " + dataSuccess);

Kotlin code snippet:

// Set custom data
val customData = mapOf("key" to "value", "number" to "42")
val dataSuccess = circleMapObject!!.setData(customData)
println("Set circle custom data: $dataSuccess")

◆ setInteractive()

abstract boolean com.navigine.idl.java.MapObject.setInteractive ( boolean interactive)
abstractinherited

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.

Java code snippet:

// Set interactive mode
boolean interactiveSuccess = circleMapObject.setInteractive(true);
System.out.println("Set circle interactive to true: " + interactiveSuccess);

Kotlin code snippet:

// Set interactive mode
val interactiveSuccess = circleMapObject!!.setInteractive(true)
println("Set circle interactive to true: $interactiveSuccess")

◆ setTitle()

abstract boolean com.navigine.idl.java.MapObject.setTitle ( String title)
abstractinherited

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.

Java code snippet:

// Set title
boolean titleSuccess = circleMapObject.setTitle("Circle Object");
System.out.println("Set circle title to 'Circle Object': " + titleSuccess);

Kotlin code snippet:

// Set title
val titleSuccess = circleMapObject!!.setTitle("Circle Object")
println("Set circle title to 'Circle Object': $titleSuccess")

◆ setVisible()

abstract boolean com.navigine.idl.java.MapObject.setVisible ( boolean visible)
abstractinherited

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.

Java code snippet:

// Set visibility
boolean visibleSuccess = circleMapObject.setVisible(true);
System.out.println("Set circle visibility to true: " + visibleSuccess);

Kotlin code snippet:

// Set visibility
val visibleSuccess = circleMapObject!!.setVisible(true)
println("Set circle visibility to true: $visibleSuccess")

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