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 static tiles are not well placed #25

Closed
cyango opened this issue Mar 4, 2021 · 2 comments
Closed

Mapbox static tiles are not well placed #25

cyango opened this issue Mar 4, 2021 · 2 comments

Comments

@cyango
Copy link

cyango commented Mar 4, 2021

Hi, just tried to use mapbox static tile server, but it seems that some tile coordinates are messed, see here:

Captura de ecrã 2021-03-04 190036

Using this

const datasource = {
    elevation: {
      apiKey: APIKEY,
    },
    imagery: {
      apiKey: APIKEY,
      urlFormat: 'https://api.mapbox.com/styles/v1/mapbox/streets-v9/tiles/{z}/{x}/{y}?access_token={apiKey}',
  
  };
@felixpalmer
Copy link
Owner

As per the documentation the imagery tile size needs to be 256x256px. I looked at the Mapbox docs at https://docs.mapbox.com/api/maps/static-tiles/ and they state that the default tile size is 512px, thus you will need to change your URL to something like:

urlFormat: 'https://api.mapbox.com/styles/v1/mapbox/streets-v9/tiles/256/{z}/{x}/{y}?access_token={apiKey}'

@cyango
Copy link
Author

cyango commented Mar 19, 2021

Ok it worked. But this doubles the API requests in this mapbox case. Is there a way we can change the imagery tilesize to 516 for out case?

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

2 participants