YMKDataSourceLayer

@interface YMKDataSourceLayer : NSObject

Undocumented

Summary

Instance methods

- (void)invalidateWithVersion:(nonnull NSString *)version;
TODO: should be removed when https://st

- (void)clear;
Clears all cached tiles and starts new requests for tiles that are displayed

- (BOOL)setStyleWithId:(NSInteger)id style:(nonnull NSString *)style;
Applies JSON style transformation to the layer

- (void)resetStyles;
Resets all JSON style transformations applied to the layer

- (void)setLayerLoadedListenerWithLayerLoadedListener:
    (nullable id<YMKLayerLoadedListener>)layerLoadedListener;

Sets layer loaded listener

- (void)remove;
Removes the data source layer from the parent layer

- (void)setDataSourceListenerWithDataSourceListener:
    (nullable id<YMKDataSourceListener>)dataSourceListener;

Sets data source listener

Properties

@property (nonatomic, assign, unsafe_unretained, readwrite, getter=isActive)
    BOOL active;

Manages visibility of the layer

@property (nonatomic, readonly, getter=isValid) BOOL valid;
Tells if this object is valid or no

Instance methods

invalidateWithVersion:

- (void)invalidateWithVersion:(nonnull NSString *)version;

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

- (void)clear;

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


setStyleWithId:style:

- (BOOL)setStyleWithId:(NSInteger)id style:(nonnull NSString *)style;

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

- (void)resetStyles;

Resets all JSON style transformations applied to the layer.


setLayerLoadedListenerWithLayerLoadedListener:

- (void)setLayerLoadedListenerWithLayerLoadedListener:
    (nullable id<YMKLayerLoadedListener>)layerLoadedListener;

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

- (void)remove;

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


setDataSourceListenerWithDataSourceListener:

- (void)setDataSourceListenerWithDataSourceListener:
    (nullable id<YMKDataSourceListener>)dataSourceListener;

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

active

@property (nonatomic, assign, unsafe_unretained, readwrite, getter=isActive)
    BOOL active;

Manages visibility of the layer.


valid

@property (nonatomic, 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.