使用mapbox卫星地图注意:
vue中使用
import mapboxgl from "mapbox-gl"
import ‘mapbox-gl/dist/mapbox-gl.css‘ // 可以在main.js中引用
import MapboxLanguage from ‘@mapbox/mapbox-gl-language‘
import MapboxGeocoder from ‘@mapbox/mapbox-gl-geocoder‘
import ‘@mapbox/mapbox-gl-geocoder/dist/mapbox-gl-geocoder.css‘
// 设置语言
if (mapboxgl.getRTLTextPluginStatus() !== ‘loaded‘) {
mapboxgl.setRTLTextPlugin(‘https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js‘)
}
this.map.addControl(new MapboxLanguage({
defaultLanguage: ‘zh‘
}));
原文:https://www.cnblogs.com/lisaShare/p/14470421.html