Custom Mapbox Studio style in Dash

Hi.

I know in Mapbox you can change between the default styles (dark, light, streets etc) via the style parameter.

However, I’d like to use a custom map created in Mapbox studio. The map has a style URL in the form of:

mapbox://styles/{username}/{styleID}

I did the following…

        mapbox = dict(
        accesstoken = mapbox_access_token,
        style = 'styleID',
    )

…but it doesn’t seem to work, which is strange because it works fine in the plotly editor when I upload the map’s json.

Any ideas?

2 Likes

Hi @chriddyp. We still didn’t manage to solve this. Not sure if you’ve had any experience of integrating a custom map?

2 Likes

Also having trouble using a mapbox style. I tried different style URLs from the Mapbox editor, or using the styleID, but can’t get it to work.

@chriddyp Any solution to this? Would be great!

2 Likes

So I think you need to pass in the full mapbox url rather then just the style id.

   mapbox = dict(
    accesstoken = mapbox_access_token,
    style = 'mapbox://styles/srepho/cjttho6dl0hl91fmzwyicqkzf'
)

This worked for me.

Strange, Srepho’s style works for me when I copy it, however my own don’t seem to work well. I need to press the Reset View, and then zoom for my own styles to load, and they don’t seem to load fully.