Change default API based URL to https://api.mapbox.cn
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
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.
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?
Hi @chriswu42 - how can I get a token that work with .cn endpoint.
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 okay, thanks!