mapbox-gl-js icon indicating copy to clipboard operation
mapbox-gl-js copied to clipboard

Change default API based URL to https://api.mapbox.cn

Open tomacadi opened this issue 8 years ago • 5 comments

Question

I am working on a map dedicated specifically for China. I am using the style mapbox://styles/mapbox/streets-zh-v1 which loads properly. Question: how can I customize the base url to always be https://api.mapbox.cn so that I can make use of faster loading maps as highlighted here: https://www.mapbox.cn/

Links to related documentation:

https://medium.com/@guanshanliu/setup-for-mapbox-cn-6097bd5fa434 https://mapbox.github.io/mapbox-gl-native/macos/0.5.1/infoplist-keys.html

tomacadi avatar May 05 '18 21:05 tomacadi

Hey @tomacadi - just to verify, you'll need a .cn access token to hit our api.mapbox.cn endpoint. I'm assuming you've gotten to this step since you were able to load the streets-zh-v1 style without any issues.

mapboxgl.config.API_URL = 'https://api.mapbox.cn'; is what you'll need to point to the .cn endpoint.

chriswu42 avatar May 08 '18 03:05 chriswu42

Indeed, that was what I was looking for. I checked again and could not find it in the documentation.: https://www.mapbox.com/mapbox-gl-js/api/ Was I looking in the wrong place?

tomacadi avatar May 13 '18 19:05 tomacadi

Hi @chriswu42 - how can I get a token that work with .cn endpoint.

vanppo avatar Oct 09 '18 07:10 vanppo

how can I get a token that work with .cn endpoint.

@vanppo please contact our sales team as we currently do not provide free access to our .cn endpoint.

chriswu42 avatar Oct 09 '18 22:10 chriswu42

@chriswu42 okay, thanks!

vanppo avatar Oct 10 '18 07:10 vanppo