| | |
| | | src: require("@/assets/img/layer/yxdt.png"), |
| | | }, |
| | | ], |
| | | sMapModelList: [], |
| | | sMapModelList: [ |
| | | { |
| | | id: "swmx", |
| | | name: "三维模型", |
| | | active: false, |
| | | type: "san", |
| | | src: require("@/assets/img/layer/swmx.png"), |
| | | }, |
| | | ], |
| | | areaTypeList: [ |
| | | { |
| | | id: "规划范围", |
| | |
| | | window.Viewer.scene.screenSpaceCameraController.maximumZoomDistance = max; |
| | | window.Viewer.scene.screenSpaceCameraController.enableTilt = enableTilt; |
| | | }, |
| | | handleMapClick(result, index) { |
| | | const val = layers.filter((res) => { |
| | | if (res.name == result.name) { |
| | | return res; |
| | | } |
| | | }); |
| | | const children = val[0].children; |
| | | if (this.curMapModelIndex == index) { |
| | | clearLayerByTypeId(result.id); |
| | | this.curMapModelIndex = -1; |
| | | } else { |
| | | this.curMapModelIndex = index; |
| | | if (result.type == "er") { |
| | | clearLayerByTypeIdArr(["ewdt", "yxdt"]); |
| | | } else { |
| | | clearLayerByTypeIdArr(["3Dcs", "swmx"]); |
| | | } |
| | | // clearLayerByTypeIdArr(['ewdt', 'yxdt', '3Dcs', 'swmx']); |
| | | _GLOBAL.layers[result.id] = []; |
| | | children.forEach((item) => { |
| | | let itemLayer = loadLayer(item); |
| | | _GLOBAL.layers[result.id].push(itemLayer); |
| | | console.log(_GLOBAL.layers[result.id]); |
| | | }); |
| | | } |
| | | }, |
| | | // handleMapClick(result, index) { |
| | | // const val = layers.filter((res) => { |
| | | // if (res.name == result.name) { |
| | | // return res; |
| | | // } |
| | | // }); |
| | | // const children = val[0].children; |
| | | // if (this.curMapModelIndex == index) { |
| | | // clearLayerByTypeId(result.id); |
| | | // this.curMapModelIndex = -1; |
| | | // } else { |
| | | // this.curMapModelIndex = index; |
| | | // if (result.type == "er") { |
| | | // clearLayerByTypeIdArr(["ewdt", "yxdt"]); |
| | | // } else { |
| | | // clearLayerByTypeIdArr(["3Dcs", "swmx"]); |
| | | // } |
| | | // // clearLayerByTypeIdArr(['ewdt', 'yxdt', '3Dcs', 'swmx']); |
| | | // _GLOBAL.layers[result.id] = []; |
| | | // children.forEach((item) => { |
| | | // let itemLayer = loadLayer(item); |
| | | // _GLOBAL.layers[result.id].push(itemLayer); |
| | | // console.log(_GLOBAL.layers[result.id]); |
| | | // }); |
| | | // } |
| | | // }, |
| | | // 二维底图选择 |
| | | handleEMapClick(result, index) { |
| | | if (this.curEMapModelIndex == index) return; |
| | |
| | | switch (result.name) { |
| | | case "二维地图": |
| | | loadGeoMap(); |
| | | loadBaseMap(); |
| | | // loadBaseMap(); |
| | | // addAnnotationLayer(); |
| | | addHxLayer(); |
| | | addYzLayer(); |
| | | window.mapapi.getView().setZoom(14); |
| | | // window.mapapi.getView().setZoom(14); |
| | | break; |
| | | case "影像地图": |
| | | addImageLayer(); |
| | |
| | | break; |
| | | } |
| | | }, |
| | | // 跳转到三维 |
| | | show3d() { |
| | | store.setLayerPanelShow(false); |
| | | this.$router.push("/viewer3D"); |
| | | }, |
| | | // 三维模型选择 |
| | | handleSMapClick(result, index) { |
| | | // 设置相机 |
| | | if (result.name == "3D城市") { |
| | | window.Viewer.scene.globe.maximumScreenSpaceError = 2; |
| | | this.changeLayerView(45000, true); |
| | | } else if (result.name == "三维模型") { |
| | | window.Viewer.scene.globe.maximumScreenSpaceError = 2; |
| | | this.changeLayerView(80000, true); |
| | | } |
| | | // // 设置相机 |
| | | // if (result.name == "3D城市") { |
| | | // window.Viewer.scene.globe.maximumScreenSpaceError = 2; |
| | | // this.changeLayerView(45000, true); |
| | | // } else if (result.name == "三维模型") { |
| | | // window.Viewer.scene.globe.maximumScreenSpaceError = 2; |
| | | // this.changeLayerView(80000, true); |
| | | // } |
| | | // 切换图层 |
| | | this.show3d(); |
| | | const val = layers.filter((res) => { |
| | | if (res.name == result.name) { |
| | | return res; |
| | |
| | | // clearLayerByTypeId(result.id); |
| | | // this.curSMapModelIndex = -1; |
| | | } else { |
| | | this.curEMapModelIndex = -1; |
| | | this.curSMapModelIndex = index; |
| | | clearLayerByTypeIdArr(["ewdt", "yxdt"]); |
| | | clearLayerByTypeIdArr(["3Dcs", "swmx"]); |
| | | _GLOBAL.layers[result.id] = []; |
| | | children.forEach((item) => { |
| | | let itemLayer = loadLayer(item); |
| | | _GLOBAL.layers[result.id].push(itemLayer); |
| | | console.log(_GLOBAL.layers[result.id]); |
| | | }); |
| | | // this.curEMapModelIndex = -1; |
| | | // this.curSMapModelIndex = index; |
| | | // clearLayerByTypeIdArr(["ewdt", "yxdt"]); |
| | | // clearLayerByTypeIdArr(["3Dcs", "swmx"]); |
| | | // _GLOBAL.layers[result.id] = []; |
| | | // children.forEach((item) => { |
| | | // let itemLayer = loadLayer(item); |
| | | // _GLOBAL.layers[result.id].push(itemLayer); |
| | | // console.log(_GLOBAL.layers[result.id]); |
| | | // }); |
| | | } |
| | | }, |
| | | // 专题图选择 |
| | |
| | | window.mapapi.removeLayer(window.tdglLine); |
| | | window.tdglLine = null; |
| | | } |
| | | |
| | | if (window.tdgllayer) { |
| | | store.setSliderShow(false); |
| | | window.mapapi.removeLayer(window.tdgllayer); |
| | |
| | | this.curFuncIndex = -1; |
| | | store.setTdglFlag(false); |
| | | store.setSliderShow(false); |
| | | window.mapapi.removeLayer(window.tdgllayer); |
| | | store.setHistoryShow(true); |
| | | break; |
| | | } |