当layer 使用了 background-pattern、fill-pattern、line-pattern、fill-extrusion-pattern、icon-image 等属性时,sprite 必填
当有 layer 使用了 text-field 属性时,glyphs 必填
1. sprite 本地化
需要两个文件:sprite@2x.json,sprite@2x.png
引入形式
sprite: "http://localhost:4000/src/components/Mapbox/mapbox_sprite/sprite"
2. glyphs 本地化
引入形式
glyphs: "http://localhost:4000/src/components/Mapbox/mapbox_font/{fontstack}/{range}.pbf"
3. 去token化
mapboxgl.accessToken = null
class Cjmapbox extends mapboxgl.Map {}
Cjmapbox.prototype.__proto__._authenticate = function () {
return true
}