From f6dd93cb0d1b0fe17674e948f0daf6ceb792bb55 Mon Sep 17 00:00:00 2001 From: Surpriseplus <845948745@qq.com> Date: 星期四, 13 七月 2023 18:59:01 +0800 Subject: [PATCH] 分屏对比,等高线,坡度图,坐标定位功能添加 --- src/views/Index.vue | 56 ++++++++++++++++++++++++++++++++++++-------------------- 1 files changed, 36 insertions(+), 20 deletions(-) diff --git a/src/views/Index.vue b/src/views/Index.vue index 7fd4f38..7b9507f 100644 --- a/src/views/Index.vue +++ b/src/views/Index.vue @@ -1,9 +1,6 @@ <template> <div class="body_box"> - <div - id="cesiumContainer" - style="width: 100%; height: 100%; position: absolute" - ></div> + <div id="cesiumContainer"></div> <export-map v-if="layerExportshow" @SETexportMap="SETexportMap" @@ -15,6 +12,12 @@ v-if="layerSpatialshow" @SETspatialClose="SETspatialClose" ></spatial-box> + <coord-location + v-if="layerLocationshow" + @SETcoordClose="setCoordLocation" + > + + </coord-location> </div> </template> @@ -38,7 +41,8 @@ import mouseMove from "@/components/mouseMove.vue"; //绌洪棿鏌ヨ import spatialBox from "@/views/query/SpatialQuery.vue"; - +//鍧愭爣瀹氫綅 +import CoordLocation from "@/views/query/CoordLocation.vue"; import router from "@/router"; import { useStore } from "vuex"; // 寮曞叆useStore 鏂规硶 @@ -47,6 +51,7 @@ const store = useStore(); // 璇ユ柟娉曠敤浜庤繑鍥瀞tore 瀹炰緥 const layerExportshow = ref(false); const layerSpatialshow = ref(false); +const layerLocationshow = ref(false); const init = () => { viewer = InitMap.Viewer; map = InitMap.sgworld; @@ -64,24 +69,18 @@ case "spatialQuery": setSpatialQuery(res); break; + case "closeNavigatBar": + setCloseNavigatBar(); + break; + case "coordLocation": + setCoordLocation(res); + break; } }; -const setSpatialQuery = async (res) => { - store.state.spatialQueryData.wkt = res.value; - - layerSpatialshow.value = true; +const setCoordLocation = (res) => { + layerLocationshow.value = res; }; -const SETspatialClose = (res) => { - layerSpatialshow.value = res; -}; -onMounted(() => { - var token = getToken(); - if (!token) { - router.push("/Login"); - } - - InitMap.init3DMap(); - init(); +const setCloseNavigatBar = () => { const infobar = document.getElementsByClassName("map-info-bar")[0]; infobar.style.display = "none"; const navigation = document.getElementsByClassName("navigation-controls")[0]; @@ -90,7 +89,24 @@ const compass = document.getElementsByClassName("compass")[0]; compass.style.top = "calc(100% - 280px)"; compass.style.right = "38px"; +}; +const setSpatialQuery = async (res) => { + store.state.spatialQueryData.wkt = res.value; + layerSpatialshow.value = true; +}; +const SETspatialClose = (res) => { + layerSpatialshow.value = res; +}; +onMounted(() => { + var token = getToken(); + if (!token) { + router.push("/Login"); + } + + InitMap.init3DMap(); + init(); + // setCloseNavigatBar(); window.functionForJs = functionForJs; }); </script> -- Gitblit v1.9.3