loadStyleUri

fun loadStyleUri(styleUri: String, onStyleLoaded: Style.OnStyleLoaded? = null, onMapLoadErrorListener: OnMapLoadErrorListener? = null)

Will load a new map style asynchronous from the specified URI.

URI can take the following forms:

  • Constants: load one of the bundled styles in Style.

  • mapbox://styles/<user>/<style>: loads the style from a Mapbox account. user is your username. style is the ID of your custom style created in Mapbox Studio.

  • http://... or https://...: loads the style over the Internet from any web server.

  • asset://...: loads the style from the APK assets directory. This is used to load a style bundled with your app.

  • file://...: loads the style from a file path. This is used to load a style from disk.

Will load an empty json {} if the styleUri is empty.

Parameters

onMapLoadErrorListener

The OnMapLoadErrorListener callback

onStyleLoaded

The OnStyleLoaded callback

styleUri

The style URI

fun loadStyleUri(styleUri: String, onStyleLoaded: Style.OnStyleLoaded)

Will load a new map style asynchronous from the specified URI.

Parameters

onStyleLoaded

The OnStyleLoaded callback

styleUri

The style URI

fun loadStyleUri(styleUri: String)

Will load a new map style asynchronous from the specified URI.

Parameters

styleUri

The style URI