| | |
| | | * @Author: shuishen 1109946754@qq.com |
| | | * @Date: 2022-08-18 17:00:30 |
| | | * @LastEditors: shuishen 1109946754@qq.com |
| | | * @LastEditTime: 2023-04-25 16:39:34 |
| | | * @LastEditTime: 2023-04-27 20:00:20 |
| | | * @FilePath: \srs-police-affairs\src\components\map\index.vue |
| | | * @Description: 公用地图组件 |
| | | * |
| | |
| | | // 地形数据添加 |
| | | that.addTerrain() |
| | | |
| | | // 外网 |
| | | // global.viewer.imageryLayers.addImageryProvider( |
| | | // 外网 // global.viewer.imageryLayers.addImageryProvider( |
| | | // new global.DC.Namespace.Cesium.UrlTemplateImageryProvider({ |
| | | // url: 'http://t{s}.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=d083e4cf30bfc438ef93436c10c2c20a', |
| | | // subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'], |
| | |
| | | // maximumLevel: 18 |
| | | // }) |
| | | // ) |
| | | |
| | | |
| | | // 设置地图初始位置,角度等 |
| | | global.viewer.camera.setView({ |
| | |
| | | |
| | | layersObjcect[layerName].addTo(global.viewer) |
| | | } else if (type == 'ClusterLayer') { |
| | | if (!layersObjcect[layerName]) layersObjcect[layerName] = null |
| | | if (!layersObjcect[layerName]) { |
| | | this.mapRemoveLayer(layerName, type) |
| | | layersObjcect[layerName] = null |
| | | } |
| | | |
| | | layersObjcect[layerName] = new global.DC.ClusterLayer(layerName, { |
| | | pixelRange: 40, style: ClusterLayerType |
| | | }) |
| | |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | destroyed () { |
| | | this.$EventBus.$off('mapAddLayer') |
| | | this.$EventBus.$off('mapRemoveLayer') |
| | | this.$EventBus.$off('mapRemovePolygonLayer') |
| | | this.$EventBus.$off('mapRemovePolygon') |
| | | this.$EventBus.$off('mapClearLayer') |
| | | this.$EventBus.$off('layerPointAdd') |
| | | this.$EventBus.$off('layerPolygonAdd') |
| | | this.$EventBus.$off('layerPolylineAdd') |
| | | this.$EventBus.$off('layerWallAdd') |
| | | this.$EventBus.$off('rowLayerWallAdd') |
| | | this.$EventBus.$off('getOverLayerID') |
| | | this.$EventBus.$off('layerShow') |
| | | this.$EventBus.$off('toPosition') |
| | | this.$EventBus.$off('highOrLightChange') |
| | | this.$EventBus.$off('addMxTileset') |
| | | this.$EventBus.$off('closeMxTileset') |
| | | this.$EventBus.$off('tilesetLayerFlag') |
| | | this.$EventBus.$off('removeMxTileset') |
| | | this.$EventBus.$off('flytoLayer') |
| | | this.$EventBus.$off('showThreeDimensions') |
| | | this.$EventBus.$off('switchThreeDimensions') |
| | | this.$EventBus.$off('clearHouse3D') |
| | | this.$EventBus.$off('registerMxClick') |
| | | this.$EventBus.$off('unbindMxClick') |
| | | } |
| | | } |
| | | </script> |