sdk-maps / com.tomtom.online.sdk.map / StyleSettings

StyleSettings

interface StyleSettings : Style, UIMapSettings

Advanced settings for style manipulation. To obtain this interface, call TomtomMap#getStyleSettings().

Inherited Functions

addImage

abstract fun addImage(image: Image): Unit

Adds an image to the style.

addLayer

abstract fun addLayer(layer: Layer): Unit

Adds a layer to the style. The layer is added above all existing layers.

addSource

abstract fun addSource(source: Source): Unit

Adds a source to the style.

findImageById

abstract fun findImageById(id: String!): Optional<Image!>

Provides access to the image with the provided id if such an image is present in the style.

findLayerById

abstract fun findLayerById(id: String): Optional<Layer!>

Provides access to the layer with a provided id if such a layer is present in the style.

findLayersById

abstract fun findLayersById(regex: String): MutableList<Layer!>

Provides access to all layers whose id matches the provided Regex.

findLayersBySourceLayerId

abstract fun findLayersBySourceLayerId(regex: String): MutableList<Layer!>

Provides access to all layers whose source layers have an id matching the provided Regex.

findSourceById

abstract fun findSourceById(id: String): Optional<Source!>

Provides access to the source with the provided id if such a source is present in the style.

getLayers

abstract fun getLayers(): MutableList<Layer!>

Provides access to all layers in the style.

loadDefaultStyle

abstract fun loadDefaultStyle(): Unit

Loads the style with the default URL based on MapStyleSource.

moveLayerBehind

abstract fun moveLayerBehind(id: String, referenceLayerId: String): Unit

Moves the layer behind the reference layer.

removeImage

abstract fun removeImage(id: String): Unit

Removes an image with a provided id from the style.

removeLayer

abstract fun removeLayer(id: String): Unit

Removes the layer with a provided id from the style.

removeSource

abstract fun removeSource(id: String): Unit

Removes the source with the provided id from the style.

setStyleJson

abstract fun setStyleJson(styleJson: String!): Unit

Sets the JSON content of the style used to display the map and reloads the style asynchronously. NOTE: This is an asynchronous operation. The user of this API needs to ensure that no methods of the StyleSettings interface are called before the style is reloaded. TomtomMapCallback.OnMapChangedListener.onDidFinishLoadingStyle is called when reloading the style is finished. An OnMapChangedListener can be registered using TomTomMap.addOnMapChangedListener.

abstract fun setStyleJson(styleJson: String!, layerSetConfiguration: LayerSetConfiguration!): Unit

Sets the JSON content of the style used to display the map and reloads the style asynchronously with the custom LayerSetConfiguration. Custom LayerSetConfiguration can only be used for Vector Tiles, Vector Traffic Flow, and Vector Traffic Incident Tiles. NOTE: This is an asynchronous operation. The user of this API needs to ensure that no methods of the StyleSettings interface are called before the style is reloaded. TomtomMapCallback.OnMapChangedListener.onDidFinishLoadingStyle is called when reloading the style is finished. An OnMapChangedListener can be registered using TomTomMap.addOnMapChangedListener.

setStyleUrl

abstract fun setStyleUrl(styleUrl: String!): Unit

Sets the URL to the style used to display the map and reloads the style asynchronously. NOTE: This is an asynchronous operation. The user of this API needs to ensure that no methods of the StyleSettings interface are called before the style is reloaded. TomtomMapCallback.OnMapChangedListener.onDidFinishLoadingStyle is called when reloading the style is finished. An OnMapChangedListener can be registered using TomTomMap.addOnMapChangedListener.

abstract fun setStyleUrl(styleUrl: String!, layerSetConfiguration: LayerSetConfiguration!): Unit

Sets the URL to the style used to display the map and reloads the style asynchronously with a custom LayerSetConfiguration. Custom LayerSetConfiguration can only be used for Vector Tiles, Vector Traffic Flow, and Vector Traffic Incident Tiles. NOTE: This is an asynchronous operation. The user of this API needs to ensure that no methods of the StyleSettings interface are called before the style is reloaded. TomtomMapCallback.OnMapChangedListener.onDidFinishLoadingStyle is called when reloading the style is finished. An OnMapChangedListener can be registered using TomTomMap.addOnMapChangedListener.