Skip to content

Default mapbox style missing #7289

Open
@ndrezn

Description

@ndrezn

For Mapbox traces, it looks like either the default style is missing or is an undocumented (required) parameter.

If my memory serves me correctly, it wasn't required to specify a style, but now if a style isn't specified we see in the console:

Error: No valid mapbox style found, please set `mapbox.style` to one of:
carto-darkmatter, carto-positron, open-street-map, stamen-terrain, stamen-toner, stamen-watercolor, white-bg
or register a Mapbox access token to use a Mapbox-served style.

This isn't related to Maplibre, I can reproduce in 2.34.0. Maybe Mapbox dropped style we set as default? Setting the styles in JS works fine.

// Define the layout
const layout = {
    mapbox: {
        // style: 'carto-darkmatter', // Equivalent to mapbox_style="carto-darkmatter"
        zoom: 10,
        center: {
            lat: 45.5, // Center latitude
            lon: -73.5 // Center longitude
        }
    },
    margin: { t: 0, b: 0, l: 0, r: 0 }
};

Here's an example: https://codepen.io/ndrezn/pen/KwPKVpY

This is a bigger issue in Python where the error is only visible in the JS console and isn't shown a Python error, so it's quite confusing to debug.

This isn't an issue in the new trace types where style has a valid default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2considered for next cyclebugsomething broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions