MapKit Mobile SDK

MMKDataSourceLayer

class MMKDataSourceLayer : NSObject

Undocumented

Summary

Instance methods

func clear()
Clears all cached tiles and starts new requests for tiles that are displayed

func setStyleWithId(_ id: Int, style: String) -> Bool
Applies JSON style transformation to the layer

func resetStyles()
Resets all JSON style transformations applied to the layer

func setLayerLoadedListenerWith( layerLoadedListener: MMKLayerLoadedListener_?)
Sets layer loaded listener

func remove()
Removes the data source layer from the parent layer

func setDataSourceListenerWith( dataSourceListener: MMKDataSourceListener_?)
Sets data source listener

Properties

var isActive: Bool { get set }
Manages visibility of the layer

var isValid: Bool { get }
Tells if this object is valid or no

Instance methods

clear()

func clear()

Clears all cached tiles and starts new requests for tiles that are displayed.


setStyleWithId(_:style:)

func setStyleWithId(_ id: Int, style: String) -> Bool

Applies JSON style transformation to the layer. Replaces previous styling with the specified ID (if such exists). Stylings are applied in an ascending order. Set to empty string to clear previous styling with the specified ID. Returns true if the style was successfully parsed and false otherwise. If the returned value is false, the current style remains unchanged.


resetStyles()

func resetStyles()

Resets all JSON style transformations applied to the layer.


setLayerLoadedListenerWith(_:)

func setLayerLoadedListenerWith( layerLoadedListener: MMKLayerLoadedListener_?)

Sets layer loaded listener.

The class does not retain the object in the 'layerLoadedListener' parameter. It is your responsibility to maintain a strong reference to the target object while it is attached to a class.


remove()

func remove()

Removes the data source layer from the parent layer. The object becomes invalid after that.


setDataSourceListenerWith(_:)

func setDataSourceListenerWith( dataSourceListener: MMKDataSourceListener_?)

Sets data source listener. Use it to invalidate data source. Temporary solution until https://st.mappable-team.ru/MAPSMOBCORE-20531 is done

The class does not retain the object in the 'dataSourceListener' parameter. It is your responsibility to maintain a strong reference to the target object while it is attached to a class.


Properties

isActive

var isActive: Bool { get set }

Manages visibility of the layer.


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.