From 22fcbf0a9ed8e0a2df9695859d7a52d1dd55b386 Mon Sep 17 00:00:00 2001 From: TreeWish <1131093754@qq.com> Date: 星期四, 09 二月 2023 10:35:39 +0800 Subject: [PATCH] 解决冲突 --- src/assets/lang/zh.js | 7 src/components/MapView/mapMenuTop.vue | 20 src/views/Synthesis/LeftMenu.vue | 1507 +++++++++++++++++++++++++++------------------------------ src/components/MapView/mapMenuPop.vue | 2 src/views/Tools/queryinfo.vue | 5 5 files changed, 737 insertions(+), 804 deletions(-) diff --git a/src/assets/lang/zh.js b/src/assets/lang/zh.js index 2427e0a..b23568a 100644 --- a/src/assets/lang/zh.js +++ b/src/assets/lang/zh.js @@ -470,7 +470,6 @@ areasurvey: "闈㈢Н娴嬮噺", volummeasure: "浣撶Н娴嬮噺", point: "鐐�", - textLabel: '鏂囨湰鐐�', line: "绾�", rectangle: "鐭╁舰", polygon: "澶氳竟褰�", @@ -478,6 +477,8 @@ flatterrain: "鍦板舰骞虫暣", terrainexcavation: "鍦板舰寮�鎸�", removepaint: "娓呴櫎缁樺埗", + addlabel: "鏂囧瓧", + textLabel: "鏂囨湰鐐�", openFile: "鎵撳紑", saveFile: "淇濆瓨", synthobj: { @@ -489,15 +490,11 @@ m6: "骞抽潰闈㈢Н", m7: "浣撶Н", m8: "瑙掑害", - m9: "楂樼▼閲忔祴", }, more: "鏇村", Multiplechoice: "澶氶��", Singlechoice: "鍗曢��", undergroundMode: "鍦颁笅妯″紡", - visibilityAnalysis: "閫氳鍒嗘瀽", - circularViewAnalysis: "鍦嗗舰瑙嗗煙鍒嗘瀽", - viewAnalysis: "瑙嗗煙鍒嗘瀽", }, dataApply: { type1: "浣滃簾", diff --git a/src/components/MapView/mapMenuPop.vue b/src/components/MapView/mapMenuPop.vue index fbc8fa8..a7c77b2 100644 --- a/src/components/MapView/mapMenuPop.vue +++ b/src/components/MapView/mapMenuPop.vue @@ -667,7 +667,7 @@ var val = Cesium.Cartesian3.fromDegrees( res.coordinates[0], res.coordinates[1], - 1000 + 200 ); this.$store.state.primitLayer.add({ position: val, diff --git a/src/components/MapView/mapMenuTop.vue b/src/components/MapView/mapMenuTop.vue index 7c76f40..bbd2eb2 100644 --- a/src/components/MapView/mapMenuTop.vue +++ b/src/components/MapView/mapMenuTop.vue @@ -206,6 +206,7 @@ this.treeChange = []; this.menuTopFrom.queryLayer = null; this.$refs.tree.setCheckedKeys([]); + }, //瀵煎叆shp鏂囦欢 async setMenuTopFile() { @@ -368,7 +369,7 @@ }); this.$bus.$emit('changeMapMenuTop', 'true'); sgworld.Creator.SimpleGraphic.edit(false, { editProp: false }); - sgworld.Creator.SimpleGraphic.clear(); + // sgworld.Creator.SimpleGraphic.clear(); //娓呯┖inputFile // var file = document.getElementById('getMenuTopFile'); // file.outerHTML = file.outerHTML; @@ -380,7 +381,22 @@ this.menuTopFrom.queryLayer = null; this.menuTopFrom.queryType = 'rectangle'; this.$refs.tree.setCheckedKeys([]); - sgworld.Creator.SimpleGraphic.clear(); + + + // //娓呴櫎瀵硅薄 + // if (window.Viewer.scene.primitives.length != null) { + // window.Viewer.scene.primitives.removeAll(); + // } + // if (this.$store.state.primitLayer != null) { + // sgworld.Creator.DeleteObject(this.$store.state.primitLayer); + // this.$store.state.primitLayer = null; + // } + //鍏抽棴绐楀彛 + this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.close("queryinfo"); + + + + }, setCartesianToEightFour(res) { var std = {}; diff --git a/src/views/Synthesis/LeftMenu.vue b/src/views/Synthesis/LeftMenu.vue index a3c61b4..d2d2206 100644 --- a/src/views/Synthesis/LeftMenu.vue +++ b/src/views/Synthesis/LeftMenu.vue @@ -5,7 +5,6 @@ @click="setChangeTwoMenu(item)" v-for="(item, index) in setListTwoMenu" :class="{ lefMenuDivActive: showTwoMenuFlag == item.id }" - :key="index" > <div class="menuTwoImage" @@ -26,10 +25,10 @@ </template> <script> -import { transform } from "ol/proj" -import mapinfo from "../Tools/mapinfo.vue" -import maplayer from "../Tools/maplayer.vue" -import queryinfo from "../Tools/queryinfo.vue" +import { transform } from 'ol/proj'; +import mapinfo from '../Tools/mapinfo.vue'; +import maplayer from '../Tools/maplayer.vue'; +import queryinfo from '../Tools/queryinfo.vue' export default { components: { mapinfo, maplayer, queryinfo }, data() { @@ -37,483 +36,482 @@ showTwoMenuFlag: false, setListTwoMenu: [], setListTwoMenuAll: [ + [ + { + id: 'a1', + label: 'synthesis.layer', + name: '鍥惧眰绠$悊', + css: 'twoMenu_imge11', + }, + + ], [ { - id: "a1", - label: "synthesis.layer", - name: "鍥惧眰绠$悊", - css: "twoMenu_imge11", + id: 'b1', + label: 'synthesis.split', + name: '鍒嗗睆', + css: 'twoMenu_imge21', + }, + { + id: 'b2', + label: 'synthesis.twod', + name: '浜岀淮', + css: 'twoMenu_imge22', + }, + { + id: 'b3', + label: 'synthesis.threed', + name: '涓夌淮', + css: 'twoMenu_imge23', + }, + { + id: 'b4', + label: 'synthesis.full', + name: '鍏ㄥ浘', + css: 'twoMenu_imge24', + }, + { + id: 'b5', + label: 'synthesis.zommin', + name: '鏀惧ぇ', + css: 'twoMenu_imge25', + }, + { + id: 'b6', + label: 'synthesis.zoomout', + name: '缂╁皬', + css: 'twoMenu_imge26', + }, + { + id: 'b7', + label: 'synthesis.rule', + name: '姣斾緥灏�', + css: 'twoMenu_imge27', + }, + { + id: 'b8', + label: 'synthesis.compass', + name: '鎸囧寳閽�', + css: 'twoMenu_imge28', + }, + { + id: 'b9', + label: 'synthesis.undergroundMode', + name: '鍦颁笅妯″紡', + css: 'twoMenu_imge29', }, ], [ { - id: "b1", - label: "synthesis.split", - name: "鍒嗗睆", - css: "twoMenu_imge21", + id: 'c1', + label: 'synthesis.someroaming', + name: '鐐规极娓�', + css: 'twoMenu_imge31', }, { - id: "b2", - label: "synthesis.twod", - name: "浜岀淮", - css: "twoMenu_imge22", + id: 'c2', + label: 'synthesis.lineroaming', + name: '绾胯矾婕父', + css: 'twoMenu_imge32', }, { - id: "b3", - label: "synthesis.threed", - name: "涓夌淮", - css: "twoMenu_imge23", + id: 'c3', + label: 'synthesis.mouseroaming', + name: '榧犳爣婕父', + css: 'twoMenu_imge33', }, { - id: "b4", - label: "synthesis.full", - name: "鍏ㄥ浘", - css: "twoMenu_imge24", + id: 'c4', + label: 'synthesis.snapshot', + name: '鍦板浘蹇収', + css: 'twoMenu_imge34', + }, + + ], + [ + { + id: 'd1', + label: 'synthesis.contouranalysis', + name: '绛夐珮绾�', + css: 'twoMenu_imge41', }, { - id: "b5", - label: "synthesis.zommin", - name: "鏀惧ぇ", - css: "twoMenu_imge25", + id: 'd2', + label: 'synthesis.slopeanalysis', + name: '鍧″害鍒嗘瀽', + css: 'twoMenu_imge42', }, { - id: "b6", - label: "synthesis.zoomout", - name: "缂╁皬", - css: "twoMenu_imge26", + id: 'd3', + label: 'synthesis.pathanalysis', + name: '璺緞鍒嗘瀽', + css: 'twoMenu_imge43', }, { - id: "b7", - label: "synthesis.rule", - name: "姣斾緥灏�", - css: "twoMenu_imge27", + id: 'd4', + label: 'synthesis.cuttinganalysis', + name: '鍦板舰鍓栧垏', + css: 'twoMenu_imge44', }, { - id: "b8", - label: "synthesis.compass", - name: "鎸囧寳閽�", - css: "twoMenu_imge28", + id: 'd5', + label: 'synthesis.floodanalysis', + name: '娣规病鍒嗘瀽', + css: 'twoMenu_imge45', }, { - id: "b9", - label: "synthesis.undergroundMode", - name: "鍦颁笅妯″紡", - css: "twoMenu_imge29", + id: 'd6', + label: 'synthesis.earthworkcalculation', + name: '鍦熸柟閲忚绠�', + css: 'twoMenu_imge46', + }, + { + id: 'd7', + label: 'synthesis.crosssectionanalysis', + name: '涓夌淮鎴潰', + css: 'twoMenu_imge47', + }, + { + id: 'd8', + label: 'synthesis.imagecontrast', + name: '褰卞儚瀵规瘮', + css: 'twoMenu_imge48', + }, + { + id: 'd9', + label: 'synthesis.pipelineAnalysis', + name: '绠¢亾鍒嗘瀽', + css: 'twoMenu_imge49', + }, + { + id: 'd10', + label: 'synthesis.flatterrain', + name: '鍦板舰骞虫暣', + css: 'twoMenu_imge410', + }, + { + id: 'd11', + label: 'synthesis.terrainexcavation', + name: '鍦板舰寮�鎸�', + css: 'twoMenu_imge411', }, ], [ { - id: "c1", - label: "synthesis.someroaming", - name: "鐐规极娓�", - css: "twoMenu_imge31", + id: 'e1', + label: 'synthesis.attributequery', + name: '灞炴�ф煡璇�', + css: 'twoMenu_imge51', }, { - id: "c2", - label: "synthesis.lineroaming", - name: "绾胯矾婕父", - css: "twoMenu_imge32", - }, - { - id: "c3", - label: "synthesis.mouseroaming", - name: "榧犳爣婕父", - css: "twoMenu_imge33", - }, - { - id: "c4", - label: "synthesis.snapshot", - name: "鍦板浘蹇収", - css: "twoMenu_imge34", + id: 'e2', + label: 'synthesis.rangequery', + name: '绌洪棿鏌ヨ', + css: 'twoMenu_imge52', }, ], [ { - id: "d1", - label: "synthesis.contouranalysis", - name: "绛夐珮绾�", - css: "twoMenu_imge41", + id: 'f1', + label: 'synthesis.gpsrtk', + name: '鍧愭爣瀹氫綅', + css: 'twoMenu_imge61', }, { - id: "d2", - label: "synthesis.slopeanalysis", - name: "鍧″害鍒嗘瀽", - css: "twoMenu_imge42", - }, - { - id: "d3", - label: "synthesis.pathanalysis", - name: "璺緞鍒嗘瀽", - css: "twoMenu_imge43", - }, - { - id: "d4", - label: "synthesis.cuttinganalysis", - name: "鍦板舰鍓栧垏", - css: "twoMenu_imge44", - }, - { - id: "d5", - label: "synthesis.floodanalysis", - name: "娣规病鍒嗘瀽", - css: "twoMenu_imge45", - }, - { - id: "d6", - label: "synthesis.earthworkcalculation", - name: "鍦熸柟閲忚绠�", - css: "twoMenu_imge46", - }, - { - id: "d7", - label: "synthesis.crosssectionanalysis", - name: "涓夌淮鎴潰", - css: "twoMenu_imge47", - }, - { - id: "d8", - label: "synthesis.imagecontrast", - name: "褰卞儚瀵规瘮", - css: "twoMenu_imge48", - }, - { - id: "d9", - label: "synthesis.pipelineAnalysis", - name: "绠¢亾鍒嗘瀽", - css: "twoMenu_imge49", - }, - { - id: "d10", - label: "synthesis.flatterrain", - name: "鍦板舰骞虫暣", - css: "twoMenu_imge410", - }, - { - id: "d11", - label: "synthesis.terrainexcavation", - name: "鍦板舰寮�鎸�", - css: "twoMenu_imge411", - }, - { - id: "d12", - label: "synthesis.visibilityAnalysis", - name: "閫氳鍒嗘瀽", - css: "twoMenu_imge412", - }, - { - id: "d13", - label: "synthesis.viewAnalysis", - name: "瑙嗗煙鍒嗘瀽", - css: "twoMenu_imge413", - }, - { - id: "d14", - label: "synthesis.circularViewAnalysis", - name: "鍦嗗舰瑙嗗煙鍒嗘瀽", - css: "twoMenu_imge414", + id: 'f2', + label: 'synthesis.placenamelocation', + name: '鍦板悕瀹氫綅', + css: 'twoMenu_imge62', }, ], [ { - id: "e1", - label: "synthesis.attributequery", - name: "灞炴�ф煡璇�", - css: "twoMenu_imge51", + id: 'j1', + label: 'synthesis.synthobj.m1', + name: '琛ㄩ潰璺濈', + css: 'twoMenu_imge71', }, { - id: "e2", - label: "synthesis.rangequery", - name: "绌洪棿鏌ヨ", - css: "twoMenu_imge52", + id: 'j2', + label: 'synthesis.synthobj.m4', + name: '鍨傜洿楂樺害', + css: 'twoMenu_imge72', + }, + { + id: 'j3', + label: 'synthesis.synthobj.m6', + name: '骞抽潰闈㈢Н', + css: 'twoMenu_imge73', + }, + { + id: 'j4', + label: 'synthesis.synthobj.m7', + name: '浣撶Н', + css: 'twoMenu_imge74', + }, + { + id: 'j5', + label: 'synthesis.synthobj.m5', + name: '琛ㄩ潰闈㈢Н', + css: 'twoMenu_imge75', + }, + { + id: 'j6', + label: 'synthesis.synthobj.m2', + name: '绌洪棿璺濈', + css: 'twoMenu_imge76', }, ], [ { - id: "f1", - label: "synthesis.gpsrtk", - name: "鍧愭爣瀹氫綅", - css: "twoMenu_imge61", + id: 'h1', + label: 'synthesis.point', + name: '鐐�', + css: 'twoMenu_imge81', }, { - id: "f2", - label: "synthesis.placenamelocation", - name: "鍦板悕瀹氫綅", - css: "twoMenu_imge62", - }, - ], - [ - { - id: "j1", - label: "synthesis.synthobj.m1", - name: "琛ㄩ潰璺濈", - css: "twoMenu_imge71", + id: 'h2', + label: 'synthesis.line', + name: '绾�', + css: 'twoMenu_imge82', }, { - id: "j2", - label: "synthesis.synthobj.m4", - name: "鍨傜洿楂樺害", - css: "twoMenu_imge72", + id: 'h3', + label: 'synthesis.rectangle', + name: '鐭╁舰', + css: 'twoMenu_imge83', }, { - id: "j3", - label: "synthesis.synthobj.m6", - name: "骞抽潰闈㈢Н", - css: "twoMenu_imge73", + id: 'h4', + label: 'synthesis.polygon', + name: '澶氳竟褰�', + css: 'twoMenu_imge84', }, { - id: "j4", - label: "synthesis.synthobj.m7", - name: "浣撶Н", - css: "twoMenu_imge74", + id: 'h5', + label: 'synthesis.import', + name: '瀵煎叆', + css: 'twoMenu_imge85', }, { - id: "j5", - label: "synthesis.synthobj.m5", - name: "琛ㄩ潰闈㈢Н", - css: "twoMenu_imge75", + id: 'h6', + label: 'synthesis.export', + name: '瀵煎嚭', + css: 'twoMenu_imge86', + }, + { + id: 'h8', + label: 'synthesis.addlabel', + name: '鏂囧瓧', + css: 'twoMenu_imge88', + }, + { + id: 'h7', + label: 'synthesis.removepaint', + name: '娓呴櫎', + css: 'twoMenu_imge87', + }, + ], [ + { + id: 'i1', + name: '鍦烘櫙鎻愬彇', + label: 'synthesis.sceneExtraction', + css: 'twoMenu_imge12', }, { - id: "j6", - label: "synthesis.synthobj.m2", - name: "绌洪棿璺濈", - css: "twoMenu_imge76", + id: 'i2', + label: 'synthesis.release', + name: '鍦烘櫙鍙戝竷', + css: 'twoMenu_imge13', + }, { + id: 'i3', + label: 'synthesis.tdisplay', + name: '涓夌淮婕旂ず', + css: 'twoMenu_imge35', }, - { - id: "j7", - label: "synthesis.synthobj.m9", - name: "楂樼▼閲忔祴", - css: "twoMenu_imge77", - }, - ], - [ - { - id: "h1", - label: "synthesis.point", - name: "鐐�", - css: "twoMenu_imge81", - }, - { - id: "h8", - label: "synthesis.textLabel", - name: "鏂囨湰鐐�", - css: "twoMenu_imge81", - }, - { - id: "h2", - label: "synthesis.line", - name: "绾�", - css: "twoMenu_imge82", - }, - { - id: "h3", - label: "synthesis.rectangle", - name: "鐭╁舰", - css: "twoMenu_imge83", - }, - { - id: "h4", - label: "synthesis.polygon", - name: "澶氳竟褰�", - css: "twoMenu_imge84", - }, - { - id: "h5", - label: "synthesis.import", - name: "瀵煎叆", - css: "twoMenu_imge85", - }, - { - id: "h6", - label: "synthesis.export", - name: "瀵煎嚭", - css: "twoMenu_imge86", - }, - { - id: "h7", - label: "synthesis.removepaint", - name: "娓呴櫎", - css: "twoMenu_imge87", - }, - ], - [ - { - id: "i1", - name: "鍦烘櫙鎻愬彇", - label: "synthesis.sceneExtraction", - css: "twoMenu_imge12", - }, - { - id: "i2", - label: "synthesis.release", - name: "鍦烘櫙鍙戝竷", - css: "twoMenu_imge13", - }, - { - id: "i3", - label: "synthesis.tdisplay", - name: "涓夌淮婕旂ず", - css: "twoMenu_imge35", - }, - ], + ] ], isRuler: false, isNaviget: false, isolineFlag: false, isslopeFlag: false, isContrastFlag: false, - UndergroundMode: false, - } + UndergroundMode: false + }; }, methods: { //浜岀礆鑿滃崟鐐瑰嚮鍒囨崲 setChangeTwoMenu(res) { - this.showTwoMenuFlag = res.id - this.$store.state.mapMenuBoolean = false - this.$store.state.mapMenuBoxFlag = null - this.$store.state.mapPopBoolean = false - this.$store.state.mapPopBoxFlag = null - var val = res.id[0] + //娓呴櫎缁樺埗鍥惧舰瀵硅薄 + sgworld.Creator.SimpleGraphic.clear(); + if (window.Viewer.scene.primitives.length != null) { + window.Viewer.scene.primitives.removeAll(); + } + if (this.$store.state.primitLayer != null) { + sgworld.Creator.DeleteObject(this.$store.state.primitLayer); + this.$store.state.primitLayer = null; + } + + //鍏抽棴鎵撳紑鐨勪俊鎭獥浣� + + + + this.showTwoMenuFlag = res.id; + this.$store.state.mapMenuBoolean = false; + this.$store.state.mapMenuBoxFlag = null; + this.$store.state.mapPopBoolean = false; + this.$store.state.mapPopBoxFlag = null; + var val = res.id[0]; if (window.model != null) { - window.model.deleteObject() - window.model = null + window.model.deleteObject(); + window.model = null; } + + + + switch (val) { - case "a": //鍥惧眰绠$悊 - this.setCoverage(res.id) - break - case "b": - this.setViewport(res.id) - break - case "c": - this.setWander(res.id) - break - case "d": - this.setAnalsy(res.id) - break - case "e": - this.setIquery(res.id) - break - case "f": - this.setOrientation(res.id) - break - case "j": - this.setMeasurement(res.id) - break - case "h": - sgworld.Creator.SimpleGraphic.edit(true, { editProp: true }) - this.setPlot(res.id) - break + case 'a': //鍥惧眰绠$悊 + this.setCoverage(res.id); + break; + case 'b': + this.setViewport(res.id); + break; + case 'c': + this.setWander(res.id); + break; + case 'd': + this.setAnalsy(res.id); + break; + case 'e': + this.setIquery(res.id); + break; + case 'f': + this.setOrientation(res.id); + break; + case 'j': + this.setMeasurement(res.id); + break; + case 'h': + sgworld.Creator.SimpleGraphic.edit(true, { editProp: true }); + this.setPlot(res.id); + break; + } }, setPlot(res) { switch (res) { - case "h1": - sgworld.Creator.createSimpleGraphic("point", {}, function (entity) { }) - break - case "h2": + case 'h1': sgworld.Creator.createSimpleGraphic( - "polyline", + 'point', {}, function (entity) { } - ) - break - case "h3": + ); + break; + case 'h2': sgworld.Creator.createSimpleGraphic( - "rectangle", + 'polyline', {}, function (entity) { } - ) - break - case "h4": + ); + break; + case 'h3': sgworld.Creator.createSimpleGraphic( - "polygon", + 'rectangle', {}, function (entity) { } - ) - break - case "h5": - this.handleOpenClick() - break - case "h6": - this.handleSaveClick() - break - case "h7": - sgworld.Creator.SimpleGraphic.clear() - - break - case "h8": - sgworld.Creator.createSimpleGraphic("label", {}, function (entity) { }) - break + ); + break; + case 'h4': + sgworld.Creator.createSimpleGraphic( + 'polygon', + {}, + function (entity) { } + ); + break; + case 'h5': + this.handleOpenClick(); + break; + case 'h6': + this.handleSaveClick(); + break; + case 'h7': + sgworld.Creator.SimpleGraphic.clear(); + break; + case 'h8': + sgworld.Creator.createSimpleGraphic('label', {}, function (entity) { + + }); + break; } }, handleSaveClick() { let funDownload = function (content, filename) { - let eleLink = document.createElement("a") - eleLink.download = filename - eleLink.style.display = "none" + let eleLink = document.createElement('a'); + eleLink.download = filename; + eleLink.style.display = 'none'; // 瀛楃鍐呭杞彉鎴恇lob鍦板潃 - let blob = new Blob([content]) - eleLink.href = URL.createObjectURL(blob) + let blob = new Blob([content]); + eleLink.href = URL.createObjectURL(blob); // 瑙﹀彂鐐瑰嚮 - document.body.appendChild(eleLink) - eleLink.click() + document.body.appendChild(eleLink); + eleLink.click(); // 鐒跺悗绉婚櫎 - document.body.removeChild(eleLink) - } - let entities = new Cesium.EntityCollection() - let dataSources = sgworld.Viewer.dataSources + document.body.removeChild(eleLink); + }; + let entities = new Cesium.EntityCollection(); + let dataSources = sgworld.Viewer.dataSources; for (let i = 0, j = dataSources.length; i < j; i++) { for (let v of dataSources.get(i).entities.values) { - entities.add(v) + entities.add(v); } } for (let v of sgworld.Viewer.entities.values) { - entities.add(v) + entities.add(v); } if (entities.values.length) { - console.log(sgworld.Viewer.entities) + console.log(sgworld.Viewer.entities); - let promise = Cesium.exportKml({ entities: sgworld.Viewer.entities }) - console.log(entities) + let promise = Cesium.exportKml({ entities: sgworld.Viewer.entities }); + console.log(entities); // let promise = Cesium.exportKml({ entities: entities }); promise.then(function (e) { - funDownload(e.kml, new Date().getTime() + ".kml") - }) + funDownload(e.kml, new Date().getTime() + '.kml'); + }); } else { - alert("褰撳墠鍦烘櫙娌℃湁entities瀹炰綋") + alert('褰撳墠鍦烘櫙娌℃湁entities瀹炰綋'); } }, + handleOpenClick() { - sgworld.Creator.SimpleGraphic.edit(true, { editProp: true }) - let fileInput = document.querySelector(".file") + sgworld.Creator.SimpleGraphic.edit(true, { editProp: true }); + let fileInput = document.querySelector('.file'); fileInput.onchange = function (evt) { - let files = evt.target.files + let files = evt.target.files; if (files.length > 0) { - let file = evt.target.files[0] - // sgworld.Creator.addKmlLayer('kml鏁版嵁', file, true); - let fileReader = new FileReader() - fileReader.readAsDataURL(file) + let file = evt.target.files[0]; + let fileReader = new FileReader(); + fileReader.readAsDataURL(file); fileReader.onload = () => { var kmlOptions = { camera: sgworld.Viewer.scene.camera, canvas: sgworld.Viewer.scene.canvas, clampToGround: true, - } - files + }; var geocachePromise = Cesium.KmlDataSource.load( fileReader.result, kmlOptions - ) + ); geocachePromise.then(function (dataSource) { - var geocacheEntities = dataSource.entities.values + var geocacheEntities = dataSource.entities.values; for (var i = 0; i < geocacheEntities.length; i++) { - var entity = geocacheEntities[i] - sgworld.Viewer.entities.add(entity) - console.log("entity", entity) + var entity = geocacheEntities[i]; + + sgworld.Viewer.entities.add(entity); } - }) + }); // sgworld.Viewer.dataSources // .add( // Cesium.KmlDataSource.load(fileReader.result, { @@ -525,82 +523,89 @@ // console.log(KmlDataSource); // // let entities = kmlDataSource.entities; // }); - } + }; } // fileInput.value = null; - } - fileInput.click() + }; + fileInput.click(); }, setLayerScene() { - var URL = window.location.href.split("#") - this.openwindow({ url: URL[0] + "LfSKyline/index.html" }) + + var URL = window.location.href.split("#"); + this.openwindow({ url: URL[0] + 'LfSKyline/index.html' }); }, openwindow(data) { - var url = data.url //杞悜缃戦〉鐨勫湴鍧�; - var name = data.title || "閫夋嫨瑕佹坊鍔犵殑椤甸潰" //缃戦〉鍚嶇О锛屽彲涓虹┖; - var iWidth = window.screen.width //寮瑰嚭绐楀彛鐨勫搴�; - var iHeight = window.screen.height //寮瑰嚭绐楀彛鐨勯珮搴�; - var iTop = 0 //鑾峰緱绐楀彛鐨勫瀭鐩翠綅缃�; - var iLeft = 0 //鑾峰緱绐楀彛鐨勬按骞充綅缃�; - window.open( - url, - name, - "height=" + - iHeight + - ",,innerHeight=" + - iHeight + - ",width=" + - iWidth + - ",innerWidth=" + - iWidth + - ",top=" + - iTop + - ",left=" + - iLeft + - ",toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no" - ) + var url = data.url; //杞悜缃戦〉鐨勫湴鍧�; + var name = data.title || '閫夋嫨瑕佹坊鍔犵殑椤甸潰'; //缃戦〉鍚嶇О锛屽彲涓虹┖; + var iWidth = window.screen.width; //寮瑰嚭绐楀彛鐨勫搴�; + var iHeight = window.screen.height; //寮瑰嚭绐楀彛鐨勯珮搴�; + var iTop = 0 //鑾峰緱绐楀彛鐨勫瀭鐩翠綅缃�; + var iLeft = 0; //鑾峰緱绐楀彛鐨勬按骞充綅缃�; + window.open(url, name, 'height=' + iHeight + ',,innerHeight=' + iHeight + ',width=' + iWidth + ',innerWidth=' + iWidth + ',top=' + iTop + ',left=' + iLeft + ',toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no'); }, + + setMeasurement(res) { switch (res) { - case "j1": + case 'j1': var measure = window.sgworld.Command.execute( 0, 2, this.colorAll, - data => { - data.id = window.sgworld.Core.getuid() - this.measureData.set(data.id, measure) - this.openMeasureResultInfo("琛ㄩ潰璺濈", data) + (data) => { + data.id = window.sgworld.Core.getuid(); + this.measureData.set(data.id, measure); + this.openMeasureResultInfo('琛ㄩ潰璺濈', data); } - ) - break - case "j6": + ); + break; + case 'j6': var measure = window.sgworld.Command.execute( 0, 10, this.colorAll, - data => { - data.id = window.sgworld.Core.getuid() - this.measureData.set(data.id, measure) - this.openMeasureResultInfo("绌洪棿璺濈", data) + (data) => { + data.id = window.sgworld.Core.getuid(); + this.measureData.set(data.id, measure); + this.openMeasureResultInfo('绌洪棿璺濈', data); } - ) - break - case "j2": + ); + break; + case 'j3': + // var measure = window.sgworld.Command.execute( + // 1, + // 11, + // this.colorAll, + // (data) => { + // data.id = window.sgworld.Core.getuid(); + // this.measureData.set(data.id, measure); + // this.openMeasureResultInfo('娴锋嫈楂樺害', data); + // } + // ); + var measure = window.sgworld.Command.execute(0, 3, this.colorAll, (data) => { + data.id = window.sgworld.Core.getuid(); + this.measureData.set(data.id, measure); + this.openMeasureResultInfo('骞抽潰闈㈢Н', data); + + + }); + + break; + case 'j2': var measure = window.sgworld.Command.execute( 0, 5, this.colorAll, - data => { - data.id = window.sgworld.Core.getuid() - this.measureData.set(data.id, measure) - this.openMeasureResultInfo("鍨傜洿楂樺害", data) + (data) => { + data.id = window.sgworld.Core.getuid(); + this.measureData.set(data.id, measure); + this.openMeasureResultInfo('鍨傜洿楂樺害', data); } - ) - break - case "j5": + ); + break; + case 'j5': var measure = window.sgworld.Command.execute( 0, 8, @@ -609,102 +614,84 @@ tin: true, // 鏄惁鏄剧ずtin涓夎缃� onlyTerrain: false, // 鏄惁鍙祴閲忕簿缁嗗湴褰� }, - data => { - data.id = window.sgworld.Core.getuid() - this.measureData.set(data.id, measure) - this.openMeasureResultInfo("琛ㄩ潰闈㈢Н", data) + (data) => { + data.id = window.sgworld.Core.getuid(); + this.measureData.set(data.id, measure); + this.openMeasureResultInfo('琛ㄩ潰闈㈢Н', data); } - ) - break - case "j3": + ); + break; + case 'j3': var measure = window.sgworld.Command.execute( 0, 3, this.colorAll, - data => { - data.id = window.sgworld.Core.getuid() - this.measureData.set(data.id, measure) - this.openMeasureResultInfo("骞抽潰闈㈢Н", data) + (data) => { + data.id = window.sgworld.Core.getuid(); + this.measureData.set(data.id, measure); + this.openMeasureResultInfo('骞抽潰闈㈢Н', data); } - ) - // sgworld.Analysis.planeArea(this.colorAll, () => {}) - break - case "j4": + ); + break; + case 'j4': var volumetricMeasurementTool = - window.sgworld.Creator.createVolumetricMeasureTool() + window.sgworld.Creator.createVolumetricMeasureTool(); volumetricMeasurementTool.startDrawing( { ...this.colorAll, onlyTerrain: false }, - "auto", - data => { + 'auto', + (data) => { if (volumetricMeasurementTool.popupData) { volumetricMeasurementTool.popupData.value = `濉柟锛�${data.volume.fill.toFixed(4) + data.unit.fill - }<br>鎸栨柟锛�${data.volume.dig.toFixed(4) + data.unit.dig}` + }<br>鎸栨柟锛�${data.volume.dig.toFixed(4) + data.unit.dig}`; } else { - data.id = window.sgworld.Core.getuid() - this.measureData.set(data.id, volumetricMeasurementTool) - let popupData = this.openMeasureResultInfo("浣撶Н鏂归噺", data) - volumetricMeasurementTool.popupData = popupData + data.id = window.sgworld.Core.getuid(); + this.measureData.set(data.id, volumetricMeasurementTool); + let popupData = this.openMeasureResultInfo('浣撶Н鏂归噺', data); + volumetricMeasurementTool.popupData = popupData; } } - ) - break - case "j8": + ); + break; + case 'j8': var measure = window.sgworld.Command.execute( 0, 12, this.colorAll, - data => { - data.id = window.sgworld.Core.getuid() - this.measureData.set(data.id, measure) - this.openMeasureResultInfo("瑙掑害", data) + (data) => { + data.id = window.sgworld.Core.getuid(); + this.measureData.set(data.id, measure); + this.openMeasureResultInfo('瑙掑害', data); } - ) - break - case "j7": - // sgworld.Analysis.altitude(this.colorAll, (data) => { - // this.measureData.set(data.id, data) - // console.log("Data", data); - // this.openMeasureResultInfo("娴锋嫈楂樺害", data) - // }) - var measure = window.sgworld.Command.execute( - 1, - 11, - this.colorAll, - data => { - data.id = window.sgworld.Core.getuid() - this.measureData.set(data.id, measure) - this.openMeasureResultInfo("娴锋嫈楂樺害", data) - } - ) - break + ); + break; } }, openMeasureResultInfo(name, data) { - let info = "" + let info = ''; switch (name) { - case "琛ㄩ潰璺濈": - case "绌洪棿璺濈": - info = "鎬婚暱搴︼細" + data.distance[data.distance.length - 1] - break - case "娴锋嫈楂樺害": - info = "楂樺害锛�" + data.height - break - case "鍨傜洿楂樺害": - info = `${data.gddistance}<br>${data.kjdistance}<br>${data.spdistance}` - break - case "琛ㄩ潰闈㈢Н": - case "骞抽潰闈㈢Н": - info = data.mj - break - case "瑙掑害": - data.labels.forEach(label => { - info += label.label.text.getValue() + "<br>" - }) - break - case "浣撶Н鏂归噺": + case '琛ㄩ潰璺濈': + case '绌洪棿璺濈': + info = '鎬婚暱搴︼細' + data.distance[data.distance.length - 1]; + break; + case '娴锋嫈楂樺害': + info = '楂樺害锛�' + data.height; + break; + case '鍨傜洿楂樺害': + info = `${data.gddistance}<br>${data.kjdistance}<br>${data.spdistance}`; + break; + case '琛ㄩ潰闈㈢Н': + case '骞抽潰闈㈢Н': + info = data.mj; + break; + case '瑙掑害': + data.labels.forEach((label) => { + info += label.label.text.getValue() + '<br>'; + }); + break; + case '浣撶Н鏂归噺': info = `濉柟锛�${data.volume.fill.toFixed(4) + data.unit.fill - }<br>鎸栨柟锛�${data.volume.dig.toFixed(4) + data.unit.dig}` - break + }<br>鎸栨柟锛�${data.volume.dig.toFixed(4) + data.unit.dig}`; + break; } return ( this.$refs && @@ -712,221 +699,183 @@ this.$refs.mapinfo.open(name, info, { close: () => { // 娓呴櫎娴嬮噺 - this.clearMeasure(data.id) + this.clearMeasure(data.id); }, }) - ) + ); }, clearMeasure(id) { if (id) { - let data = this.measureData.get(id) - data && data.deleteObject && data.deleteObject() + let data = this.measureData.get(id); + data && data.deleteObject && data.deleteObject(); // 浣撶Н鏂归噺 - data && data.cleanUp && data.cleanUp() - this.measureData.delete(id) + data && data.cleanUp && data.cleanUp(); + this.measureData.delete(id); } else { - this.measureData.forEach(data => { - data.deleteObject && data.deleteObject() + this.measureData.forEach((data) => { + data.deleteObject && data.deleteObject(); // 浣撶Н鏂归噺 - data.cleanUp && data.cleanUp() - }) - this.measureData.clear() + data.cleanUp && data.cleanUp(); + }); + this.measureData.clear(); } }, setIquery(res) { switch (res) { - case "e2": - this.$store.state.mapMenuBoolean = true - this.$store.state.mapMenuBoxFlag = "1" - break - case "e1": - this.$store.state.mapMenuBoolean = true - this.$store.state.mapMenuBoxFlag = "2" - break + case 'e2': + this.$store.state.mapMenuBoolean = true; + this.$store.state.mapMenuBoxFlag = '1'; + break; + case 'e1': + this.$store.state.mapMenuBoolean = true; + this.$store.state.mapMenuBoxFlag = '2'; + break; } }, setAnalsy(res) { - var that = this + //this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.close("queryinfo"); + var that = this; switch (res) { - case "d1": - that.isolineFlag = !that.isolineFlag - elevationTool.tf = that.isolineFlag - elevationTool.render() - break - case "d2": - that.isslopeFlag = !that.isslopeFlag + case 'd1': + that.isolineFlag = !that.isolineFlag; + elevationTool.tf = that.isolineFlag; + elevationTool.render(); + break; + case 'd2': + that.isslopeFlag = !that.isslopeFlag; if (that.isslopeFlag == true) { - elevationTool.type = "slope" + elevationTool.type = 'slope'; } else { - elevationTool.type = "none" + elevationTool.type = 'none'; } - elevationTool.render() - break - case "d3": + elevationTool.render(); + break; + case 'd3': var value = { - name: "Analysis", + name: 'Analysis', id: 3, - } - this.$bus.$emit("mapChangeBox", value) - break - case "d4": + }; + this.$bus.$emit('mapChangeBox', value); + break; + case 'd4': if (window.AnalysisDXPM) { - this.clear(res) + this.clear(res); } else { - this.addterrainSectionAnalysis() + this.addterrainSectionAnalysis(); } - break - case "d5": + break; + case 'd5': if (window.AnalysisFlood) { - this.clear(res) + this.clear(res); } else { - this.addAnalysisFlood() + this.addAnalysisFlood(); } - break - case "d6": - var that = this + break; + case 'd6': + var that = this; var volumetricMeasurementTool = - sgworld.Creator.createVolumetricMeasureTool() + sgworld.Creator.createVolumetricMeasureTool(); volumetricMeasurementTool.startDrawing( { ...this.colorAll, onlyTerrain: false }, - "auto", - data => { + 'auto', + (data) => { if (volumetricMeasurementTool.popupData) { volumetricMeasurementTool.popupData.value = `濉柟锛�${data.volume.fill.toFixed(4) + data.unit.fill - }<br>鎸栨柟锛�${data.volume.dig.toFixed(4) + data.unit.dig}` + }<br>鎸栨柟锛�${data.volume.dig.toFixed(4) + data.unit.dig}`; } else { - data.id = sgworld.Core.getuid() - this.measureData.set(data.id, volumetricMeasurementTool) - let popupData = that.openMeasureResultInfo("浣撶Н鏂归噺", data) - volumetricMeasurementTool.popupData = popupData + data.id = sgworld.Core.getuid(); + this.measureData.set(data.id, volumetricMeasurementTool); + let popupData = that.openMeasureResultInfo('浣撶Н鏂归噺', data); + volumetricMeasurementTool.popupData = popupData; } } - ) - break - case "d7": - var that = this + ); + break; + case 'd7': + var that = this; window.model = sgworld.Creator.create3DTilesets( - "", + '', modelUrl, {}, {}, - "0", + '0', true, - data => { - sgworld.Navigate.flyToObj(data) - that.setclippingModel() + (data) => { + sgworld.Navigate.flyToObj(data); + that.setclippingModel(); } - ) - break - case "d9": - this.$store.state.mapPopBoxFlag = "3" - this.$refs && - this.$refs.queryinfo && - this.$refs.queryinfo.open("绠¢亾绌洪棿鍒嗘瀽", null, { - close: () => { - if (this.$store.state.pipelineEntity.length != 0) { - for (var i in this.$store.state.pipelineEntity) { - var item = this.$store.state.pipelineEntity[i] - sgworld.Viewer.entities.remove(item) - } + ); + break; + case 'd9': + this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.close("queryinfo"); + this.$store.state.mapPopBoxFlag = '3'; + + this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.open("绠¢亾绌洪棿鍒嗘瀽", null, { + close: () => { + if (this.$store.state.pipelineEntity.length != 0) { + for (var i in this.$store.state.pipelineEntity) { + var item = this.$store.state.pipelineEntity[i] + sgworld.Viewer.entities.remove(item); } - }, - }) - break - case "d8": + } + } + }); + break; + case 'd8': if (this.isContrastFlag == false) { - this.isContrastFlag = true - sgworld.Analysis.createCurtainContrast(2, 1) + this.isContrastFlag = true; + sgworld.Analysis.createCurtainContrast(2, 1); } else { - this.isContrastFlag = false - sgworld.Analysis.clearCurtainContrast() + this.isContrastFlag = false; + sgworld.Analysis.clearCurtainContrast(); } - break - case "d10": + break; + case 'd10': if (window.TerrainFlattening) { - window.TerrainFlattening.remove() - window.TerrainFlattening = null + window.TerrainFlattening.remove(); + window.TerrainFlattening = null; } else { sgworld.Creator.createSimpleGraphic( - "polygon", + 'polygon', { clampToGround: true, }, function (entity) { - var positions = entity.polygon.hierarchy.getValue().positions - sgworld.Creator.SimpleGraphic.remove(entity.id) + var positions = entity.polygon.hierarchy.getValue().positions; + sgworld.Creator.SimpleGraphic.remove(entity.id); window.TerrainFlattening = sgworld.Creator.createTerrainModifier( - "鍦板舰鍘嬪钩", + '鍦板舰鍘嬪钩', positions, 10, {} - ) + ); } - ) + ); } - break + break; - case "d11": + case 'd11': if (window.Excavation) { - window.Excavation.clear() - window.Excavation = null + window.Excavation.clear(); + window.Excavation = null; } else { window.Excavation = sgworld.Analysis.TerrainExcavation( 10, {}, function () { } - ) + ); } - break - case "d12": - if (window.Excavation) { - window.Excavation.deleteObject() - window.Excavation = null - } else { - window.Excavation = sgworld.Analysis.createSightLine({ - type: "default", - }) - } - break - case "d13": - if (window.Excavation) { - window.Excavation.destroy() - window.Excavation = null - } else { - window.Excavation = sgworld.Analysis.create3DViewshedPoss({ - height: 1.8, - }) - } - break - case "d14": - if (window.Excavation) { - window.Excavation.close() - window.Excavation = null - } else { - var SYFX_visible_color = { r: 0.0, g: 1.0, b: 0.0 }, - SYFX_notVisible_color = { r: 1.0, g: 0.0, b: 0.0 } - window.Excavation = sgworld.Analysis.create3DViewshed({ - name: "Viewshed On Frederick", - height: 1.8, - color: { - Back: SYFX_notVisible_color, - Fore: SYFX_visible_color, - }, - isSpherical: "spherical", - }) - } - - break + break; } }, setclippingModel() { if (window.model) { setTimeout(() => { window.model.clippingModel({ - direction: "z", - }) - }, 1000) + direction: 'z', + }); + }, 1000); // window.model.clippingModel({ // direction: 'z', // }); @@ -934,20 +883,20 @@ }, clear(res) { switch (res) { - case "d4": - layer.close(this.dxpmIndex) - this.dxpmIndex = undefined + case 'd4': + layer.close(this.dxpmIndex); + this.dxpmIndex = undefined; if (window.AnalysisDXPM) { window.AnalysisDXPM.flyPoint && - Viewer.entities.remove(window.AnalysisDXPM.flyPoint) - window.AnalysisDXPM && window.AnalysisDXPM.deleteObject() - window.AnalysisDXPM = undefined + Viewer.entities.remove(window.AnalysisDXPM.flyPoint); + window.AnalysisDXPM && window.AnalysisDXPM.deleteObject(); + window.AnalysisDXPM = undefined; } - break - case "d5": - window.AnalysisFlood.endWater() - window.AnalysisFlood = undefined - break + break; + case 'd5': + window.AnalysisFlood.endWater(); + window.AnalysisFlood = undefined; + break; } }, addAnalysisFlood() { @@ -955,216 +904,197 @@ pointSelect: true, spood: 20, GroupID: 0, - url: "/SmartEarthSDK/Workers/image/waterNormals.jpg", - } - window.AnalysisFlood = sgworld.Command.execute(2, 2, method, value => { }) + url: '/SmartEarthSDK/Workers/image/waterNormals.jpg', + }; + window.AnalysisFlood = sgworld.Command.execute( + 2, + 2, + method, + (value) => { } + ); }, addterrainSectionAnalysis() { window.AnalysisDXPM = sgworld.Command.execute( 2, 6, { cyjj: 50, objid: 0 }, - Distance => { + (Distance) => { if (Distance.gcs && Distance.gcs.length) { - var url = window.location.href - var testurl = "" - if (url.indexOf("web") != -1) { - testurl = "/web" + var url = window.location.href; + var testurl = ''; + if (url.indexOf('web') != -1) { + testurl = '/web'; } - window.AnalysisDXPM.analyseData = Distance + window.AnalysisDXPM.analyseData = Distance; this.dxpmIndex = layer.open({ type: 2, - title: "鍒嗘瀽缁撴灉", + title: '鍒嗘瀽缁撴灉', shade: false, - area: ["80%", "280px"], - offset: "b", - skin: "other-class", - content: - testurl + "/SmartEarthSDK/Workers/analysis/AnalysisDXPM.html", + area: ['80%', '280px'], + offset: 'b', + skin: 'other-class', + content: testurl + '/SmartEarthSDK/Workers/analysis/AnalysisDXPM.html', end: () => { - this.dxpmIndex && this.clear("d4") + this.dxpmIndex && this.clear('d4'); }, - }) + }); } else { //鍓栭潰 - window.AnalysisDXPM && window.AnalysisDXPM.deleteObject() + window.AnalysisDXPM && window.AnalysisDXPM.deleteObject(); } } - ) + ); }, setWander(res) { switch (res) { - case "c1": - window.sgworld.Analysis.setPointFly() - break - case "c2": - var url = window.location.href - var testurl = "" - if (url.indexOf("web") != -1) { - testurl = "/web" + case 'c1': + window.sgworld.Analysis.setPointFly(); + break; + case 'c2': + var url = window.location.href; + var testurl = ''; + if (url.indexOf('web') != -1) { + testurl = '/web'; } - window.sgworld.Command.execute(2, 3, "", data => { - data.showPoint = false - data.showLine = true - data.mode = 1 + window.sgworld.Command.execute(2, 3, '', (data) => { + data.showPoint = false; + data.showLine = true; + data.mode = 1; // 寮圭獥鏁版嵁 window.PathAnimationData = { flyData: data, - } + }; window.PathAnimationData.winIndex = layer.open({ type: 2, - title: "璺緞鍔ㄧ敾", + title: '璺緞鍔ㄧ敾', shade: false, - area: ["352px", "690px"], - offset: "r", - skin: "other-class", - content: testurl + "/SmartEarthSDK/Workers/path/Path.html", + area: ['352px', '690px'], + offset: 'r', + skin: 'other-class', + content: testurl + '/SmartEarthSDK/Workers/path/Path.html', end: function () { - PathAnimationData.fly && PathAnimationData.fly.exit() + PathAnimationData.fly && PathAnimationData.fly.exit(); }, - }) - }) - break - case "c3": - sgworld.Analysis.createindoormode({ showHelp: true }) - break - case "c4": - window.sgworld.Analysis.createScreenshot() - break + }); + }); + break; + case 'c3': + sgworld.Analysis.createindoormode({ showHelp: true }); + break; + case 'c4': + window.sgworld.Analysis.createScreenshot(); + break; } }, setOrientation(res) { - var resid + var resid; switch (res) { - case "f1": - resid = 1 - break - case "f2": - resid = 2 - break + case 'f1': + resid = 1; + break; + case 'f2': + resid = 2; + break; } var val = { - name: "Coord", + name: 'Coord', id: resid, - } - this.$bus.$emit("mapChangeBox", val) + }; + this.$bus.$emit('mapChangeBox', val); }, setViewport(res) { switch (res) { - case "b1": //鍒嗗睆 - this.$bus.$emit("changemap", 1) - break - case "b2": //浜岀淮 - this.$bus.$emit("changemap", 2) - break - case "b3": //涓夌淮 - this.$bus.$emit("changemap", 3) - break - case "b4": //鍏ㄥ浘 + case 'b1': //鍒嗗睆 + this.$bus.$emit('changemap', 1); + break; + case 'b2': //浜岀淮 + this.$bus.$emit('changemap', 2); + break; + case 'b3': //涓夌淮 + this.$bus.$emit('changemap', 3); + break; + case 'b4': //鍏ㄥ浘 window.sgworld.Navigate.jumpTo({ //璺宠浆瑙嗚 destination: new Cesium.Cartesian3.fromDegrees(110, 32, 8000000), - }) + }); window.map .getView() - .setCenter(transform([110, 32], "EPSG:4326", "EPSG:3857")) - window.map.getView().setZoom(4) - break - case "b5": //鏀惧ぇ - window.sgworld.Navigate.zoomIn() + .setCenter(transform([110, 32], 'EPSG:4326', 'EPSG:3857')); + window.map.getView().setZoom(4); + break; + case 'b5': //鏀惧ぇ + window.sgworld.Navigate.zoomIn(); // 鑾峰彇褰撳墠瑙嗗浘 - var zoom = window.map.getView().getZoom() // 鑾峰彇褰撳墠缂╂斁绾у埆 - window.map.getView().setZoom(zoom + 1) // 璁剧疆缂╂斁绾у埆 + var zoom = window.map.getView().getZoom(); // 鑾峰彇褰撳墠缂╂斁绾у埆 + window.map.getView().setZoom(zoom + 1); // 璁剧疆缂╂斁绾у埆 - break - case "b6": //缂╁皬 - window.sgworld.Navigate.zoomOut() - var zoom = window.map.getView().getZoom() // 鑾峰彇褰撳墠缂╂斁绾у埆 - window.map.getView().setZoom(zoom - 1) // 璁剧疆缂╂斁绾у埆 - break - case "b7": //姣斾緥灏� - this.isRuler = !this.isRuler - window.sgworld.navControl("scale", this.isRuler) - let scale = document.querySelector(".ol-scale-line") - let zoomCtrl = document.querySelector(".ol-zoom") - - if (!this.isRuler) { - scale.style.display = "none" - zoomCtrl.style.display = "none" - } else { - scale.style.display = "block" - zoomCtrl.style.display = "block" - } - - break - case "b8": //鎸囧寳閽� - this.isNaviget = !this.isNaviget - window.sgworld.navControl("nav", this.isNaviget) - let rotate = document.querySelector(".ol-rotate") - let fullscreen = document.querySelector(".ol-full-screen") - - if (!this.isNaviget) { - rotate.style.display = "none" - fullscreen.style.display = "none" - } else { - rotate.style.display = "block" - fullscreen.style.display = "block" - } - - break - case "b9": //鍦颁笅妯″紡 - this.UndergroundMode = !this.UndergroundMode + break; + case 'b6': //缂╁皬 + window.sgworld.Navigate.zoomOut(); + var zoom = window.map.getView().getZoom(); // 鑾峰彇褰撳墠缂╂斁绾у埆 + window.map.getView().setZoom(zoom - 1); // 璁剧疆缂╂斁绾у埆 + break; + case 'b7': //姣斾緥灏� + this.isRuler = !this.isRuler; + window.sgworld.navControl('scale', this.isRuler); + break; + case 'b8': //鎸囧寳閽� + this.isNaviget = !this.isNaviget; + window.sgworld.navControl('nav', this.isNaviget); + break; + case 'b9': //鍦颁笅妯″紡 + this.UndergroundMode = !this.UndergroundMode; window.sgworld.Analysis.UndergroundMode(this.UndergroundMode, 0.3) - break + break; } }, setCoverage(res) { switch (res) { - case "a1": + case 'a1': if (this.$store.state.layerMnage == false) { - this.$refs && this.$refs.maplayer && this.$refs.maplayer.closeAll() - this.$refs && this.$refs.maplayer && this.$refs.maplayer.open() - this.$store.state.layerMnage = true + this.$refs && this.$refs.maplayer && this.$refs.maplayer.closeAll(); + this.$refs && this.$refs.maplayer && this.$refs.maplayer.open(); + this.$store.state.layerMnage = true; } else if (this.$store.state.layerMnage == true) { - this.$refs && this.$refs.maplayer && this.$refs.maplayer.closeAll() - this.$store.state.layerMnage = false + this.$refs && this.$refs.maplayer && this.$refs.maplayer.closeAll(); + this.$store.state.layerMnage = false; } - break + break; } }, menuChange(res) { - this.setListTwoMenu = this.setListTwoMenuAll[res] + this.setListTwoMenu = this.setListTwoMenuAll[res]; }, }, mounted() { - this.measureData = new Map() + this.measureData = new Map(); this.colorAll = { - point: Cesium.Color.fromCssColorString("#ff0000"), - polyline: Cesium.Color.fromCssColorString("#ffff00").withAlpha(0.6), - polygon: Cesium.Color.fromCssColorString("#ffff00").withAlpha(0.6), - } - this.$bus.$on("setChangeTwoMenu", res => { - if (res == 8) { - this.setLayerScene() - } else { - this.menuChange(res) - } - }) + point: Cesium.Color.fromCssColorString('#ff0000'), + polyline: Cesium.Color.fromCssColorString('#ffff00').withAlpha(0.6), + polygon: Cesium.Color.fromCssColorString('#ffff00').withAlpha(0.6), + }; + this.$bus.$on('setChangeTwoMenu', (res) => { - this.$store.state.showAllLayers = true - this.$store.state.layerMnage = false - this.setCoverage("a1") + if (res == 8) { this.setLayerScene(); } else { + this.menuChange(res); + } + + }); + + this.$store.state.showAllLayers = true; + this.$store.state.layerMnage = false; + this.setCoverage('a1'); }, -} +}; </script> <style lang="less" scoped> .menu_Box { width: 100%; height: 100%; - background: #303030; - color: white; + margin: 0; padding: 0; overflow-y: auto; @@ -1303,19 +1233,6 @@ background: url("../../assets/img/synthesis/鐭╁舰 14 鎷疯礉 7.png") no-repeat center; } - // 閫氳鍒嗘瀽銆佽鍩熷垎鏋� 棰勭暀 - .twoMenu_imge412 { - background: url("../../assets/img/synthesis/鐭╁舰 14 鎷疯礉 7.png") no-repeat - center; - } - .twoMenu_imge413 { - background: url("../../assets/img/synthesis/鐭╁舰 14 鎷疯礉 7.png") no-repeat - center; - } - .twoMenu_imge414 { - background: url("../../assets/img/synthesis/鐭╁舰 14 鎷疯礉 7.png") no-repeat - center; - } //鏌ヨ .twoMenu_imge51 { background: url("../../assets/img/synthesis/鍥惧眰 23.png") no-repeat center; @@ -1352,11 +1269,6 @@ .twoMenu_imge76 { background: url("../../assets/img/synthesis/绌洪棿娴嬭窛.png") no-repeat center; } - // 楂樺眰閲忔祴鍥炬爣 - .twoMenu_imge77 { - background: url("../../assets/img/synthesis/鍥惧眰 31 鎷疯礉.png") no-repeat - center; - } //鏍囩粯 .twoMenu_imge81 { background: url("../../assets/img/synthesis/妞渾 5 鎷疯礉 3.png") no-repeat @@ -1383,5 +1295,8 @@ .twoMenu_imge87 { background: url("../../assets/img/synthesis/娓呴櫎.png") no-repeat center; } + .twoMenu_imge88 { + background: url("../../assets/img/synthesis/鍥惧眰 32.png") no-repeat center; + } } </style> diff --git a/src/views/Tools/queryinfo.vue b/src/views/Tools/queryinfo.vue index c88d807..5f689f6 100644 --- a/src/views/Tools/queryinfo.vue +++ b/src/views/Tools/queryinfo.vue @@ -61,10 +61,15 @@ // 鍏抽棴寮圭獥 close(id) { let index = this.PopupData.findIndex((item) => { + console.log(item); return item.id === id; }); let data = this.PopupData.splice(index, 1)[0]; data.close && data.close(); + + + + }, // 鎵撳紑寮圭獥 open(title, value, style = {}) { -- Gitblit v1.9.3