Closed DuShuYuan closed 2 years ago
在ready函数中加载本地shp文件
onViewerReady ({ Cesium, viewer }) { // eslint-disable-next-line no-unused-vars var worldLayer = null // eslint-disable-next-line no-unused-vars var worldProvider = new VectorTileImageryProvider({ source: 'http://localhost:1379/map/shp/区域_全球国界.shp', defaultStyle: { outlineColor: 'rgb(255,0,0)', lineWidth: 1, fill: false, tileCacheSize: 200, showMaker: false, showCenterLabel: true, fontColor: 'rgba(255,0,0,1)', labelOffsetX: -10, labelOffsetY: -5, fontSize: 13, fontFamily: '黑体', centerLabelPropertyName: 'NAME' }, maximumLevel: 20, minimumLevel: 1, simplify: false }) worldProvider.readyPromise.then(function () { worldLayer = viewer.imageryLayers.addImageryProvider(worldProvider) }) }
报错信息: Uncaught (in promise) TypeError: Cannot set properties of undefined (setting 'defaultAccessToken') at load (webpack-internal:///./node_modules/vue-cesium/es/components/viewer/src/useViewer.mjs:487:28)
https://github.com/zouyaoji/vue-cesium/issues/155
在ready函数中加载本地shp文件
报错信息: Uncaught (in promise) TypeError: Cannot set properties of undefined (setting 'defaultAccessToken') at load (webpack-internal:///./node_modules/vue-cesium/es/components/viewer/src/useViewer.mjs:487:28)