Interface SublayerManager

com.yandex.mapkit.map

public interface SublayerManager

Provides interface to change drawing order of the map layers.

Methods

Sublayer appendSublayer(@NonNull String layerId, @NonNull SublayerFeatureType featureType)

Creates the new sublayer and appends it to the list.

Integer findFirstOf(@NonNull String layerId)

Finds the first sublayer which belongs to the layer with the specified ID and returns its index.

Integer findFirstOf(@NonNull String layerId, @NonNull SublayerFeatureType featureType)

Finds the first sublayer which belongs to the layer with the specified ID and contains features of the required type, and returns its index.

Sublayer get(int sublayerIndex)

Returns the sublayer with the specified index.

Sublayer insertSublayerAfter(int to, @NonNull String layerId, @NonNull SublayerFeatureType featureType)

Creates the new sublayer and inserts it before sublayer with the specified index.

Sublayer insertSublayerBefore(int to, @NonNull String layerId, @NonNull SublayerFeatureType featureType)

Creates the new sublayer and inserts it after sublayer with the specified index.

boolean isValid()

Tells if this SublayerManager is valid or no.

void moveAfter(int from, int to)

Moves the sublayer to the position after sublayer with the specified index.

void moveBefore(int from, int to)

Moves the sublayer to the position before sublayer with the specified index.

void moveToEnd(int from)

Moves the sublayer with the specified index to the end of the list.

void remove(int sublayerIndex)

Removes the sublayer with the specified index.

int size()

Returns size of the list of sublayers.

Method Detail

appendSublayer

public Sublayer appendSublayer (@NonNull String layerId, @NonNull SublayerFeatureType featureType)

Creates the new sublayer and appends it to the list.

findFirstOf

public Integer findFirstOf (@NonNull String layerId)

Finds the first sublayer which belongs to the layer with the specified ID and returns its index.

Returns none, if no such sublayer exists.

findFirstOf

public Integer findFirstOf (@NonNull String layerId, @NonNull SublayerFeatureType featureType)

Finds the first sublayer which belongs to the layer with the specified ID and contains features of the required type, and returns its index.

Returns none, if no such sublayer exists.

get

public Sublayer get (int sublayerIndex)

Returns the sublayer with the specified index.

Returns none, if no such sublayer exists.

insertSublayerAfter

public Sublayer insertSublayerAfter (int to, @NonNull String layerId, @NonNull SublayerFeatureType featureType)

Creates the new sublayer and inserts it before sublayer with the specified index.

insertSublayerBefore

public Sublayer insertSublayerBefore (int to, @NonNull String layerId, @NonNull SublayerFeatureType featureType)

Creates the new sublayer and inserts it after sublayer with the specified index.

isValid

public boolean isValid ()

Tells if this SublayerManager is valid or no.

Any other method (except for this one) called on an invalid SublayerManager will throw java.lang.RuntimeException. An instance 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.

moveAfter

public void moveAfter (int from, int to)

Moves the sublayer to the position after sublayer with the specified index.

moveBefore

public void moveBefore (int from, int to)

Moves the sublayer to the position before sublayer with the specified index.

moveToEnd

public void moveToEnd (int from)

Moves the sublayer with the specified index to the end of the list.

remove

public void remove (int sublayerIndex)

Removes the sublayer with the specified index.

size

public int size ()

Returns size of the list of sublayers.