setStyle

open fun setStyle(style: String)

Loads a new map style from the specified bundled style.

This method is asynchronous and will return before the style finishes loading. If you wish to wait for the map to finish loading, listen to the MapView.OnDidFinishLoadingStyleListener callback or use the setStyle method instead.

If the style fails to load or an invalid style URL is set, the map view will become blank. An error message will be logged in the Android logcat and MapView.OnDidFailLoadingMapListener callback will be triggered.

Parameters

style

The bundled style

See also


open fun setStyle(style: String, callback: Style.OnStyleLoaded)

Loads a new map style from the specified bundled style.

If the style fails to load or an invalid style URL is set, the map view will become blank. An error message will be logged in the Android logcat and MapView.OnDidFailLoadingMapListener callback will be triggered.

Parameters

style

The bundled style

callback

The callback to be invoked when the style has loaded

See also


open fun setStyle(builder: Style.Builder)

Loads a new map style from the specified builder.

If the builder fails to load, the map view will become blank. An error message will be logged in the Android logcat and MapView.OnDidFailLoadingMapListener callback will be triggered. If you wish to wait for the map to finish loading, listen to the MapView.OnDidFinishLoadingStyleListener callback or use the setStyle instead.

Parameters

builder

The style builder

See also


open fun setStyle(builder: Style.Builder, callback: Style.OnStyleLoaded)

Loads a new map style from the specified builder.

If the builder fails to load, the map view will become blank. An error message will be logged in the Android logcat and MapView.OnDidFailLoadingMapListener callback will be triggered.

Parameters

builder

The style builder

callback

The callback to be invoked when the style has loaded

See also