Interface MapObject

An object displayed on the map.

Methods

void addTapListener(@NonNull MapObjectTapListener tapListener)

Adds a tap listener to the object.

MapObjectCollection getParent()

Returns the collection of map objects that the current map object belongs to.

Object getUserData()

Use this property to attach any object-related metadata.

float getZIndex()

Gets the z-index, which affects: 1) Rendering order.

boolean isDraggable()

If true, the map object can be dragged by the user.

boolean isValid()

Tells if this MapObject is valid or no.

boolean isVisible()

Manages visibility of the object on the map.

void removeTapListener(@NonNull MapObjectTapListener tapListener)

Removes the tap listener from the object.

void setDragListener(@Nullable MapObjectDragListener dragListener)

Sets a drag listener for the object.

void setDraggable(boolean draggable)
void setUserData(@Nullable Object userData)
void setVisible(boolean visible)
void setVisible(boolean visible, @NonNull Animation animation, @Nullable Callback onFinished)

Manages visibility of the object.

void setZIndex(float zIndex)

Method Detail

addTapListener

public void addTapListener (@NonNull MapObjectTapListener tapListener)

Adds a tap listener to the object.

getParent

public MapObjectCollection getParent ()

Returns the collection of map objects that the current map object belongs to.

getUserData

public Object getUserData ()

Use this property to attach any object-related metadata.

Optional property, can be null.

getZIndex

public float getZIndex ()

Gets the z-index, which affects: 1) Rendering order.

2) Dispatching of UI events (taps and drags are dispatched to objects with higher z-indexes first). Z-index is relative to the parent.

isDraggable

public boolean isDraggable ()

If true, the map object can be dragged by the user.

Default: false.

isValid

public boolean isValid ()

Tells if this MapObject is valid or no.

Any other method (except for this one) called on an invalid MapObject will throw java.lang.RuntimeException. An instance becomes invalid only on UI thread, and only when its implementation depends on objects already destroyed by now. Please refer to general docs about the interface for details on its invalidation.

isVisible

public boolean isVisible ()

Manages visibility of the object on the map.

Default: true.

removeTapListener

public void removeTapListener (@NonNull MapObjectTapListener tapListener)

Removes the tap listener from the object.

setDragListener

public void setDragListener (@Nullable MapObjectDragListener dragListener)

Sets a drag listener for the object.

Each object can only have one drag listener.Remark:
Parameters:
dragListener

has optional type, it may be uninitialized.

setDraggable

public void setDraggable (boolean draggable)

setUserData

public void setUserData (@Nullable Object userData)

setVisible

public void setVisible (boolean visible)

setVisible

public void setVisible (boolean visible, @NonNull Animation animation, @Nullable Callback onFinished)

Manages visibility of the object.

Parameters:
animation

Describes the transition between visible and not visible states.

onFinished

Called when the transition is finished.

Remark:
Parameters:
onFinished

has optional type, it may be uninitialized.

setZIndex

public void setZIndex (float zIndex)