Mapbox GL JS access token 问题

使用Mapbox GL JS时出现如下错误
Error: A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/

解决方法:
(1)MapBox在内网使用时,accesstoken不能使用,导致局域网内地图服务不能使用,只需修改mapbox-gl.js文件中“this._requestManager._customAccessToken,(e=>{if(e&&(false))”,框架就不会验证token,可内网部署。参考来源:https://blog.csdn.net/qq_58543270/article/details/121921553

Mapbox GL JS下载地址:
https://github.com/mapbox/mapbox-gl-js
https://github.com/mapbox/mapbox-gl-js/releases
https://gitee.com/mirrors/Mapbox-GL-JS

你可能感兴趣的:(前端,mapboxgl)