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

Append sku and access_token url parameters to any tile requests that require them (raster-dem) #2285

Open
Gnative opened this issue Jan 22, 2025 · 2 comments

Comments

@Gnative
Copy link

Gnative commented Jan 22, 2025

I've found that when I'm trying to use a custom map style.json that uses the mapbox://mapbox.mapbox-terrain-dem-v1 tiles this requires an sku url parameter along with an access_token to be correctly accessed, else a response of 403 is thrown. This limits the use of these tiles for normal and offline use via a custom style.

I've had to use mapbox://mapbox.terrain-rgb instead so Mapbox is missing out on the user session identifier with this approach.

These parameters are correctly added when using a style directly from the Mapbox API.

Solutions could be either

  1. Pass along these url parameters to the custom style for use by the developer
  2. Append parameters with in the SDK to any tile source requests if they need it or not
  3. Append parameters with in the SDK to any tile source requests for only Mapbox tile sources such as mapbox://mapbox.mapbox-terrain-dem-v1 if they are a source from the Mapbox style or a custom style
@Gnative Gnative changed the title Append sku tokens to any source type url requests that require them. Append sku tokens to any tile requests that require them. Jan 22, 2025
@Gnative Gnative changed the title Append sku tokens to any tile requests that require them. Append sku and access_token to any tile requests that require them. Jan 22, 2025
@Gnative Gnative changed the title Append sku and access_token to any tile requests that require them. Append sku and access_token url parameters to any tile requests that require them (raster-dem) Jan 22, 2025
@Gnative
Copy link
Author

Gnative commented Feb 15, 2025

OK I just found that the mapbox://mapbox.terrain-rgb terrain tiles around Kazakhstan are really bad and the mapbox://mapbox.mapbox-terrain-dem-v1 tiles are much better.

It would be nice to have a solution to this problem.

@Gnative
Copy link
Author

Gnative commented Feb 15, 2025

We could use the SKU generator via https://github.com/mapbox/mapbox-gl-js/blob/main/src/util/sku_token.ts#L21 but this explicitly mentions,

  • Under the Mapbox Terms of Service, you may not use this code to access Mapbox
  • Mapping APIs other than through Mapbox SDKs.

I'm not sure if the use of this via the mapbox-ios-sdk or mapbo-andriod-sdk is covered if i'm using m own custom style json

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

1 participant