MapboxStyleManager

Wrapper class for StyleManager allowing to expose style related methods for MapboxMap.

Functions

Link copied to clipboard
fun addGeoJSONSourceFeatures(sourceId: String, dataId: String, features: MutableList<Feature>): Expected<String, None>

Add additional features to a GeoJSON style source.

Link copied to clipboard
Link copied to clipboard
fun addPersistentStyleLayer(properties: Value, layerPosition: LayerPosition?): Expected<String, None>

Adds a new style layer.

Link copied to clipboard

Adds a custom geometry to be used in the style. To add the data, implement the CustomGeometrySourceOptions.Builder.fetchTileFunction callback in the options and call setStyleCustomGeometrySourceTileData

Link copied to clipboard
fun addStyleCustomLayer(layerId: String, layerHost: CustomLayerHost, layerPosition: LayerPosition?): Expected<String, None>

Adds a new style custom layer.

Link copied to clipboard

Note! This is an experimental feature. It can be changed or removed in future versions.

Link copied to clipboard
fun addStyleImage(imageId: String, scale: Float, image: Image, sdf: Boolean, stretchX: MutableList<ImageStretches>, stretchY: MutableList<ImageStretches>, content: ImageContent?): Expected<String, None>

Adds an image to be used in the style. This API can also be used for updating an image. If the image for a given imageId was already added, it gets replaced by the new image.

Link copied to clipboard
fun addStyleLayer(properties: Value, layerPosition: LayerPosition?): Expected<String, None>

Adds a new style layer.

Link copied to clipboard
fun addStyleSource(sourceId: String, properties: Value): Expected<String, None>

Adds a new style source. Note: When adding a geojson source, this method does not synchronously parse the GeoJSON data. The events API shall be used to make sure the provided GeoJSON data is valid. In case the GeoJSON is valid, a MapLoaded event will be propagated. In case of errors, a MapLoadingError event will be propagated instead.

Link copied to clipboard

Gets the value of a style atmosphere property.

Link copied to clipboard
fun getStyleImage(imageId: String): Image?

Get an image from the style.

Link copied to clipboard
Link copied to clipboard

Gets the value of style import config.

Link copied to clipboard

Returns the existing style imports.

Link copied to clipboard

Gets style import schema.

Link copied to clipboard

Gets style layer properties.

Link copied to clipboard

Gets the value of style layer property.

Link copied to clipboard

Returns the existing style layers.

Link copied to clipboard

Gets the value of a style projection property.

Link copied to clipboard

Gets style source properties.

Link copied to clipboard

Gets the value of style source property.

Link copied to clipboard

Returns the existing style sources.

Link copied to clipboard

Gets the value of a style terrain property.

Link copied to clipboard

Returns the map style's transition options. By default, the style parser will attempt to read the style default transition options, if any, fallback-ing to an immediate transition otherwise. Transition options can be overridden via setStyleTransition, but the options are reset once a new style has been loaded.

Link copied to clipboard

Checks whether an image exists.

Invalidate region for provided custom geometry source.

Link copied to clipboard

Invalidate tile for provided custom geometry source.

Link copied to clipboard

Note! This is an experimental feature. It can be changed or removed in future versions.

Link copied to clipboard

Note! This is an experimental feature. It can be changed or removed in future versions.

Link copied to clipboard

Checks if a style layer is persistent.

Link copied to clipboard

Check if the style is completely loaded.

Link copied to clipboard
fun moveStyleLayer(layerId: String, layerPosition: LayerPosition?): Expected<String, None>

Moves an existing style layer

Link copied to clipboard

Remove features from a GeoJSON style source.

Link copied to clipboard

Removes an image from the style.

Link copied to clipboard

Removes an existing style import.

Link copied to clipboard

Removes an existing style layer.

Link copied to clipboard

Removes an existing style source.

Link copied to clipboard

Sets the style global atmosphere properties.

Link copied to clipboard

Sets a value to the the style atmosphere property.

Link copied to clipboard
fun setStyleCustomGeometrySourceTileData(sourceId: String, tileId: CanonicalTileID, featureCollection: MutableList<Feature>): Expected<String, None>

Set tile data of a custom geometry.

Link copied to clipboard

Note! This is an experimental feature. It can be changed or removed in future versions.

Link copied to clipboard

Sets style import config. This method can be used to perform batch update for a style import configurations.

Link copied to clipboard

Sets a value to a style import config.

Link copied to clipboard
fun setStyleLayerProperties(layerId: String, properties: Value): Expected<String, None>

Sets style layer properties. This method can be used to perform batch update for a style layer properties. The structure of a provided properties value must conform to a format for a corresponding layer type. Modification of a layer id and/or a layer type (https://docs.mapbox.com/mapbox-gl-js/style-spec/layers/#type) is not allowed.

Link copied to clipboard
fun setStyleLayerProperty(layerId: String, property: String, value: Value): Expected<String, None>

Sets a value to a style layer property.

Link copied to clipboard

Sets the map's projection. If called with NULL, the map will reset to Mercator.

Link copied to clipboard

Sets a value to the the style projection property.

Link copied to clipboard
fun setStyleSourceProperties(sourceId: String, properties: Value): Expected<String, None>

Sets style source properties.

Link copied to clipboard
fun setStyleSourceProperty(sourceId: String, property: String, value: Value): Expected<String, None>

Sets a value to a style source property. Note: When setting the "data" property of a geojson source, this method does not synchronously parse the GeoJSON data. The events API shall be used to make sure the provided GeoJSON data is valid. In case the GeoJSON is valid, a MapLoaded event will be propagated. In case of errors, a MapLoadingError event will be propagated instead.

Link copied to clipboard

Sets the style global terrain properties.

Link copied to clipboard

Sets a value to the the style terrain property.

Link copied to clipboard
fun setStyleTransition(transitionOptions: TransitionOptions)

Overrides the map style's transition options with user-provided options.

Link copied to clipboard

Checks whether a given style layer exists.

Link copied to clipboard

Checks whether a given style source exists.

Link copied to clipboard
fun updateGeoJSONSourceFeatures(sourceId: String, dataId: String, features: MutableList<Feature>): Expected<String, None>

Update existing features in a GeoJSON style source.

Link copied to clipboard

Updates the image of an image style source.

Properties

Link copied to clipboard

Returns the map style's default camera, if any, or a default camera otherwise. The map style's default camera is defined as follows:

Inheritors

Link copied to clipboard