| | |
| | | <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" |
| | |
| | | v-if="layerSpatialshow" |
| | | @SETspatialClose="SETspatialClose" |
| | | ></spatial-box> |
| | | <coord-location |
| | | v-if="layerLocationshow" |
| | | @SETcoordClose="setCoordLocation" |
| | | > |
| | | |
| | | </coord-location> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | 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 方法 |
| | | |
| | |
| | | const store = useStore(); // 该方法用于返回store 实例 |
| | | const layerExportshow = ref(false); |
| | | const layerSpatialshow = ref(false); |
| | | const layerLocationshow = ref(false); |
| | | const init = () => { |
| | | viewer = InitMap.Viewer; |
| | | map = InitMap.sgworld; |
| | |
| | | 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]; |
| | |
| | | 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> |