| | |
| | | </template> |
| | | |
| | | <script> |
| | | let tdglLayer; |
| | | import { |
| | | loadHXQ, |
| | | loadJKQ, |
| | |
| | | curFuncIndex: -1, |
| | | curZTIndex: -1, |
| | | state: store.thematicLayer, |
| | | basicMapChecked: store.basicMapChecked.val, |
| | | }; |
| | | }, |
| | | mounted() { |
| | |
| | | 1 |
| | | ); |
| | | loadEnterprise(); |
| | | }, 1000); |
| | | }, 2000); |
| | | }); |
| | | }, |
| | | methods: { |
| | | changeLayerView(max, enableTilt) { |
| | | 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) { |
| | |
| | | }, |
| | | // 二维底图选择 |
| | | handleEMapClick(result, index) { |
| | | // 设置相机 |
| | | if (result.name == "二维地图") { |
| | | this.changeLayerView(25000, false); |
| | | } else if (result.name == "影像地图") { |
| | | this.changeLayerView(50000, false); |
| | | } |
| | | // 切换图层 |
| | | const val = layers.filter((res) => { |
| | | if (res.name == result.name) { |
| | | return res; |
| | |
| | | }, |
| | | // 三维模型选择 |
| | | handleSMapClick(result, index) { |
| | | // 设置相机 |
| | | if (result.name == "3D城市") { |
| | | this.changeLayerView(45000, true); |
| | | } else if (result.name == "三维模型") { |
| | | this.changeLayerView(80000, true); |
| | | } |
| | | // 切换图层 |
| | | const val = layers.filter((res) => { |
| | | if (res.name == result.name) { |
| | | return res; |
| | |
| | | } |
| | | this.curFuncIndex = -1; |
| | | window.clusterLayer && window.clusterLayer.clear(); |
| | | if (tdglLayer) { |
| | | sgworld.Creator.DeleteObject(tdglLayer); |
| | | if (window.tdglLayer) { |
| | | sgworld.Creator.DeleteObject(window.tdglLayer); |
| | | } |
| | | } else { |
| | | // 隐藏底部图层面版 |
| | |
| | | this.curFuncIndex = index; |
| | | switch (index) { |
| | | case 0: |
| | | tdglLayer = sgworld.Creator.createImageryProvider( |
| | | window.tdglLayer = sgworld.Creator.createImageryProvider( |
| | | layers[8].name, |
| | | "tms", |
| | | { |
| | |
| | | "" |
| | | ); |
| | | store.setTdglFlag(true); |
| | | |
| | | break; |
| | | case 1: |
| | | this.curFuncIndex = -1; |
| | | store.setTdglFlag(false); |
| | | if (tdglLayer) { |
| | | sgworld.Creator.DeleteObject(tdglLayer); |
| | | if (window.tdglLayer) { |
| | | sgworld.Creator.DeleteObject(window.tdglLayer); |
| | | } |
| | | store.setHistoryShow(true); |
| | | break; |
| | |
| | | watch: { |
| | | "state.itemId": { |
| | | handler: function (newVal, oldVal) { |
| | | debugger; |
| | | let that = this; |
| | | if (newVal == "") { |
| | | this.curAreaTypeIndex = -1; |
| | |
| | | } |
| | | }, |
| | | }, |
| | | // 基础图层 |
| | | "basicMapChecked.val": { |
| | | handler: function (newVal, oldVal) { |
| | | if (newVal == "三维模型") { |
| | | this.handleSMapClick( |
| | | { |
| | | id: "swmx", |
| | | name: "三维模型", |
| | | active: false, |
| | | type: "san", |
| | | src: require("@/assets/img/layer/swmx.png"), |
| | | }, |
| | | 1 |
| | | ); |
| | | } |
| | | }, |
| | | immediate: true, //刷新加载 立马触发一次handler |
| | | deep: true, // 可以深度检测到 obj 对象的属性值的变化 |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |