[Bug] Mapbox with custom mapbox style object - access token not found
See original GitHub issueFollowing the plotly mapbox-layers doc, I am trying to change the layout.mapbox.style
attribute from ‘light’ (default Light mapbox) to a custom mapbox style object (cf. spec)
Both require an access token, which I have.
When setting the style to ‘light’ the access token is well found, can be tested in the following codepen.
But when using a custom style object it seems we lose track of the mapboxAccessToken
config attribute. (cf. this codepen).
I also tried to pass the access token as a query parameter as I saw in some mapbox methods we would parse it that way: normalizeTileURL
We could do a PR on the mapbox repository to add the same logic in: normalizeSpriteUrl
but I feel like it’s more a matter of Plotly correctly passing the access token to the mapbox API.
I think we could fix that by adding the access token to the options passed to the Map constructor, here
I’ll test that.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
It seems to work, I’ll create a PR
I tested it again, and could not reproduce the issue. I guess I did a mistake when reading Codepen logs, I’m very sorry for the waste of time, thank you.
I’m closing this issue. (Tested my Codepens & the
mapbox_custom-style.json
test)