Black Lives Matter. Please consider donating to Black Girls Code today.

Hide specific layer from generic mapbox map

I’ve created a dashboard with a map (from Mapbox) and multiple plots around it. It works just fine, although there is a minor tweak I can’t apply: I would like to hide the sea labels.
Using Mapbox Studio I managed to do it by hiding the layer named Marine Labels. But, how can I do it in my code?
The code (the relevant part of it) looks like these:

layout = go.Layout(
        plot_bgcolor= 'rgba(0,0,0,1)',
        paper_bgcolor= 'rgba(0,0,0,1)',
        autosize=True,
        hovermode='closest',
        mapbox=dict(
            accesstoken=mapbox_access_token,
            bearing=0,
            center=dict(
                lat=0,
                lon=0
            ),
            pitch=0,
            zoom=7,
            style='dark'
        ),
    )

Thanks

Hey @pullo

if you have done it in Mapbox Studio and published the map, then you ought to be able to use that in your plotly map.

mapbox = dict(
   accesstoken=<enter access_token>,
   style='mapbox://<enter your map style>'
)

Hi @bcd,

Thanks for that. I did try that before, and it obviously makes sense when generating the map from Mapbox Studio. However, I would also like to take a “raw” standard map from Mapbox and tweak only a few details, like style (dark), initial zoom and positioning, and then also adding/removing some labels.

I’m not sure how easy that would be though.