diff --git a/src/views/modules/cpts/base/cpts/edit.vue b/src/views/modules/cpts/base/cpts/edit.vue index f68dc9f78..436a923bd 100644 --- a/src/views/modules/cpts/base/cpts/edit.vue +++ b/src/views/modules/cpts/base/cpts/edit.vue @@ -628,7 +628,7 @@ export default { // 定义map变量,调用 TMap.Map() 构造函数创建地图 map = new window.TMap.Map(document.getElementById("app"), { center: center, // 设置地图中心点坐标 - zoom: 15, // 设置地图缩放级别 + zoom: 13, // 设置地图缩放级别 pitch: 43.5, // 设置俯仰角 rotation: 45, // 设置地图旋转角度 }); diff --git a/src/views/modules/visual/command/cpts/map.vue b/src/views/modules/visual/command/cpts/map.vue index 90a24bde8..675c056fd 100644 --- a/src/views/modules/visual/command/cpts/map.vue +++ b/src/views/modules/visual/command/cpts/map.vue @@ -147,25 +147,12 @@ export default { }, }, - computed: {}, - components: { cptCard, cptTb, cptPopup, }, - watch: {}, - - async mounted() { - // 临时这么用吧 - window._AMapSecurityConfig = { - securityJsCode: "92ea2c965c6cf1ba7ee3a8fe01449ef2", - }; - - this.iniMap(); - }, - computed: { polygonData() { const { srcGridData } = this; @@ -314,6 +301,20 @@ export default { }, }, + async mounted() { + console.log("指挥调度map初始化啦"); + // 临时这么用吧 + window._AMapSecurityConfig = { + securityJsCode: "92ea2c965c6cf1ba7ee3a8fe01449ef2", + }; + + this.iniMap(); + + // 为了避免刷新残留 + searchMarker = null; + searchBgLayer = null; + }, + methods: { iniMap() { const { darkStyle, lightStyle, srcGridData } = this; @@ -680,10 +681,11 @@ export default { } if (searchBgLayer) { + console.log("searchBgLayer已经存在了", searchBgLayer); searchBgLayer.setData(sourceData); } else { searchBgLayer = new PolygonLayer({ - // autoFit: true, + // autoFit: true, }) .source(sourceData) .color("#f0f") @@ -733,10 +735,14 @@ export default { }, removeDotMarker() { + console.log("removeDotMarker"); if (searchMarker) { searchMarker.remove(); } - this.drawSearchBg(); + if (searchBgLayer) { + console.log("removeDotMarker-----searchBgLayer"); + this.drawSearchBg(); + } }, // 把地图缩放等级在原来基础上大一点