MMKMapObject
class MMKMapObject : NSObject |
An object displayed on the map.
Summary
Instance methods
func setVisibleWithVisible(_ visible: Bool, |
func addTapListener(with tapListener: MMKMapObjectTapListener) |
func removeTapListener(with tapListener: MMKMapObjectTapListener) |
func setDragListenerWith( dragListener: MMKMapObjectDragListener_?) |
Properties
var parent: MMKBaseMapObjectCollection { get } |
var isVisible: Bool { get set } |
var zIndex: Float { get set } |
var isDraggable: Bool { get set } |
var userData: Any? { get set } |
var isValid: Bool { get } |
Instance methods
setVisibleWithVisible(_:animation:callback:)
func setVisibleWithVisible(_ visible: Bool, |
Manages visibility of the object.
Parameters |
|
animation |
Describes the transition between visible and not visible states. |
onFinished |
Called when the transition is finished. |
addTapListener(with:)
func addTapListener(with tapListener: MMKMapObjectTapListener) |
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(with:)
func removeTapListener(with tapListener: MMKMapObjectTapListener) |
Removes the tap listener from the object.
setDragListenerWith(_:)
func setDragListenerWith( dragListener: MMKMapObjectDragListener_?) |
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.
Properties
parent
var parent: MMKBaseMapObjectCollection { get } |
Returns the collection of map objects that the current map object belongs to.
isVisible
var isVisible: Bool { get set } |
Manages visibility of the object on the map. Default: true.
zIndex
var zIndex: Float { get set } |
Gets the z-index, which affects:
- Rendering order.
- Dispatching of UI events (taps and drags are dispatched to objects with higher z-indexes first).
isDraggable
var isDraggable: Bool { get set } |
If true, the map object can be dragged by the user. Default: false.
userData
var userData: Any? { get set } |
Use this property to attach any object-related metadata.
Optional property, can be nil.
isValid
var isValid: Bool { get } |
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.