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.

Same problem here. Srepho’s style works, but not my own style. Can you solve this?

@srepho did you set any special configuration in your style? I can’t understand why your style works, but not other styles.

Thanks.

Hey, so ive come across the same problem right now. @srepho Your style works,but mine also wont work until i press Reset View and even then its not as i have configured. Has anyone found the solution yet? Or ist on Mapbox´s side?

three reasons why you should buy plotly pro: support open source, get great support, host your plots and dashboards online