Package world.mappable.mapkit.map
Interface MapObject
All known Subinterfaces:
BaseMapObjectCollection, CircleMapObject, PlacemarkMapObject, PolygonMapObject, PolylineMapObject
interface MapObject
An object displayed on the map.
Summary
Methods
Type and modifiers |
Method and Description |
getParent() |
|
boolean |
isVisible() |
void |
setVisible(boolean visible) |
void |
setVisible(boolean visible, |
float |
getZIndex()
|
void |
setZIndex(float zIndex) |
boolean |
isDraggable() |
void |
setDraggable(boolean draggable) |
java.lang.Object |
getUserData() |
void |
setUserData(@Nullable java.lang.Object userData) |
void |
addTapListener(@NonNull MapObjectTapListener tapListener) |
void |
removeTapListener(@NonNull MapObjectTapListener tapListener) |
void |
setDragListener(@Nullable MapObjectDragListener dragListener) |
boolean |
isValid() |
Methods
getParent
@NonNull |
Returns the collection of map objects that the current map object belongs to.
isVisible
boolean isVisible() |
Manages visibility of the object on the map.
Default: true.
setVisible
void setVisible(boolean visible) |
setVisible
void setVisible(boolean visible, |
Manages visibility of the object.
Parameters |
|
|
Describes the transition between visible and not visible states. |
|
Called when the transition is finished. |
getZIndex
float getZIndex() |
Gets the z-index, which affects:
- Rendering order.
- Dispatching of UI events (taps and drags are dispatched to objects with higher z-indexes first).
setZIndex
void setZIndex(float zIndex) |
isDraggable
boolean isDraggable() |
If true, the map object can be dragged by the user.
Default: false.
setDraggable
void setDraggable(boolean draggable) |
getUserData
@Nullable |
Use this property to attach any object-related metadata.
Optional property, can be null.
setUserData
void setUserData(@Nullable java.lang.Object userData) |
addTapListener
void addTapListener(@NonNull MapObjectTapListener tapListener) |
Adds a tap listener to the object.
The class does not retain the object in the 'tapListener' parameter. It is your responsibility to maintain a strong reference to the target object while it is attached to a class.
removeTapListener
void removeTapListener(@NonNull MapObjectTapListener tapListener) |
Removes the tap listener from the object.
setDragListener
void setDragListener(@Nullable MapObjectDragListener dragListener) |
Sets a drag listener for the object.
Each object can only have one drag listener.
The class does not retain the object in the 'dragListener' parameter. It is your responsibility to maintain a strong reference to the target object while it is attached to a class.
isValid
boolean isValid() |
Tells if this MapObject is valid or not.
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.