Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapbox custom styles not working with staticMap() #17

Open
mikima opened this issue May 3, 2018 · 3 comments
Open

Mapbox custom styles not working with staticMap() #17

mikima opened this issue May 3, 2018 · 3 comments

Comments

@mikima
Copy link

mikima commented May 3, 2018

setting as option style:mapbox://styles/username/mapid mappa.js will load this url:

https://api.mapbox.com/styles/v1/mapbox/mapbox://styles/username/mapid/static/0,0,1,0,0/640x640?access_token=XYZ

According to documentation, the correct url should be:

https://api.mapbox.com/styles/v1/username/mapid/static/0,0,1,0,0/640x640?access_token=XYZ

@cvalenzuela
Copy link
Owner

great, will fix. thanks!

@pzhine
Copy link

pzhine commented Nov 26, 2018

@mikima, you can work around this in the current release by setting a username and style id in your options:

options = {
    username: 'pzhine',
    style: 'cjoyiufdc3zhi2smr3ws3upbr',
    lng: 2.147821,
    lat: 41.373632,
    zoom: 10.9,
    scale: 1,
    pitch: 0,
  }, 

Note that these options will probably not work with mappa.tileMap(options), because this relies on the mapbox://styles/username/mapid format for the style field. It would probably be a good idea to normalize these.

@mikima
Copy link
Author

mikima commented Nov 27, 2018

@pzhine thanks but with the latest version I thought the bug was solved, indeed just setting the mapbox://styles/username/mapid style it works now. Tested with the latest version of mappa (commit 551e2c9).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants