YMKDataSourceLayer

class YMKDataSourceLayer : NSObject

Undocumented

Summary

Instance methods

func invalidate(withVersion version: String)
TODO: should be removed when https://st

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: YMKLayerLoadedListener_?)
Sets layer loaded listener

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

func setDataSourceListenerWith( dataSourceListener: YMKDataSourceListener_?)
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

invalidate(withVersion:)

func invalidate(withVersion version: String)

TODO: should be removed when https://st.yandex-team.ru/MAPSMOBCORE-16640 is done

Invalidates data source and reloads all tiles. Must not be called if DataSource does not support versioning: LayerOptions.versionSupport = false;

This method may be called on any thread. Its implementation must be thread-safe.


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: YMKLayerLoadedListener_?)

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: YMKDataSourceListener_?)

Sets data source listener. Use it to invalidate data source.

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.


Предыдущая
Следующая