Style
The general class to interact with Styles in the Modular Mapbox Maps SDK for Android. It exposes the entry point for all methods related to the Style. You cannot instantiate Style object directly, rather, you must obtain one from the getStyle(onStyleLoaded) method on MapboxMap.
Note: Similar to a View object, a Style should only be read and modified from the main thread.
Types
A convenience object to access the style ID strings of the professionally-designed map styles made by Mapbox.
Callback to be invoked when a style has finished loading.
Functions
Adds an image to be used in the style. This API can also be used for updating an image. If the image id was already added, it gets replaced by the new image.
Adds a new style custom layer.
Adds a new style layer.
Adds a custom geometry to be used in the style. To add the data, implement the CustomGeometrySourceOptions.fetchTileFunction callback in the options and call setStyleCustomGeometrySourceTileData
Adds a new style custom layer.
Adds an image to be used in the style. This API can also be used for updating an image. If the image id was already added, it gets replaced by the new image.
Adds a new style layer.
Gets the value of a style atmosphere property.
Returns the map style's default camera, if any, or a default camera otherwise. The map style default camera is defined as follows:
Get an image from the style.
Get the JSON serialization string of the current Mapbox Style in use.
Gets style layer properties.
Gets the value of style layer property.
Returns the existing style layers.
Gets the value of a style light property.
This API is for internal use only and will return a no-op result.
This API is for internal use only and will return a no-op result.
Gets the value of a style projection property.
Gets style source parameters. In order to convert returned value to a json string please take a look at Value.toJson.
Gets the value of style source property.
Returns the existing style sources.
Returns the current sources metadata.
Get the value of a style terrain property.
Returns the map style's transition options. By default, the style parser will attempt to read the style default transition options, if any, fallbacking to an immediate transition otherwise. Transition options can be overridden via setStyleTransition, but the options are reset once a new style has been loaded.
Get the URI of the current Mapbox Style in use.
Checks whether an image exists.
Checks whether a model exists.
Invalidate region for provided custom geometry source.
Invalidate tile for provided custom geometry source.
Checks if a style layer is persistent.
Check if the style is completely loaded.
Moves an existing style layer.
Removes an image from the style.
Removes an existing style layer
Removes a model from the style.
Removes an existing style source.
Sets the style global atmosphere properties.
Set tile data of a custom geometry.
This method is for internal use.
Load the style from a provided JSON string.
Sets the style global light source properties.
Sets a value to the the style light property.
This API is for internal use only and will return a no-op result.
Sets the map's projection. If called with null
, the map will reset to Mercator.
Sets style source parameters. This method can be used to perform batch update for a style source parameters. The structure of a provided parameters
value must conform to Style Specification - Sources format for a corresponding source type. Modification of a source type https://docs.mapbox.com/mapbox-gl-js/style-spec/sources/#type is not allowed.
Sets the style global terrain source properties.
Overrides the map style's transition options with user-provided options.
Load style from provided URI.
Checks whether a given style layer exists.
Checks whether a given style source exists.
Subscribes an Observer to a provided list of event types. Observable will hold a strong reference to an Observer instance, therefore, in order to stop receiving notifications, caller must call unsubscribe with an Observer instance used for an initial subscription.
Unsubscribes an Observer from all events.
Unsubscribes an Observer from a provided list of event types.