Class YMKMapObject

An object displayed on the map.

Instance Methods

- addTapListenerWithTapListener:

Adds a tap listener to the object.

- removeTapListenerWithTapListener:

Removes the tap listener from the object.

- setDragListenerWithDragListener:

Sets a drag listener for the object.

- setVisibleWithVisible:animation:callback:

Manages visibility of the object.

Properties

draggable

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

parent

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

userData

Use this property to attach any object-related metadata.

valid

Tells if this object is valid or no.

visible

Manages visibility of the object on the map.

zIndex

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

Method Detail

-addTapListenerWithTapListener:

- (void)addTapListenerWithTapListener:(nonnull id< YMKMapObjectTapListener >)tapListener 

Adds a tap listener to the object.

-removeTapListenerWithTapListener:

- (void)removeTapListenerWithTapListener:(nonnull id< YMKMapObjectTapListener >)tapListener 

Removes the tap listener from the object.

-setDragListenerWithDragListener:

- (void)setDragListenerWithDragListener:(nullable id< YMKMapObjectDragListener >)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.

-setVisibleWithVisible:animation:callback:

- (void)setVisibleWithVisible:(BOOL)visible
                    animation:(nonnull YMKAnimation *)animation
                     callback:(nullable YMKCallback)callback 

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.

Property Detail

draggable

(assign, readwrite, getter=isDraggable) BOOL draggable

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

Default: false.

parent

(assign, readonly) YMKMapObjectCollection * parent

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

userData

(assign, readwrite) id userData

Use this property to attach any object-related metadata.

Optional property, can be nil.

valid

(assign, readonly, getter=isValid) BOOL valid

Tells if this object is valid or no.

Any method called on an invalid object will throw an exception. The object 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.

visible

(assign, readwrite, getter=isVisible) BOOL visible

Manages visibility of the object on the map.

Default: true.

zIndex

(assign, readwrite) float zIndex

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.