Skip to main content

Map styles

The Navigation SDK UX Framework is pre-built with the default map styles: day, night, satellite and 3D. As a user, you can switch between them through app settings. The transition between day and night map styles depends on the system theme.

You can use default ones or set up your own styles through the configuration object like this:

val config = DashConfig.create(
applicationContext = applicationContext,
accessToken = getString(R.string.mapbox_access_token)
) {
mapstyleConfig {
dayStyleUri = <day_style_uri>
nightStyleUri = <night_style_uri>
satelliteStyleUri = <satellite_style_uri>
map3dStyleUri = <map_3D_style_uri>
// The map custom pixel ratio. By default, it is set to null
pixelRatio = <pixel_ratio_float_value>
}
}
Dash.init(config)

Usually a style uri points to mapbox studio style id:

mapbox://styles/<mapbox-account-name>/<style-id>

But in some cases, it might be needed to load a map style from a local JSON file. In such cases you can put the style JSON in the asset folder and load it from there:

asset://<style-name>.json
Was this page helpful?