From 1b179a0ac410e77b7ec3d187f7ca5fb4af23a997 Mon Sep 17 00:00:00 2001 From: jihongshun <1151753686@qq.com> Date: 星期三, 24 九月 2025 11:51:57 +0800 Subject: [PATCH] 解决读取kmz问题 --- src/utils/components/cesium-map.vue | 47 ++++++++++++++++++++++++++++++++--------------- 1 files changed, 32 insertions(+), 15 deletions(-) diff --git a/src/utils/components/cesium-map.vue b/src/utils/components/cesium-map.vue index ab1d56c..5546d1d 100644 --- a/src/utils/components/cesium-map.vue +++ b/src/utils/components/cesium-map.vue @@ -1,23 +1,23 @@ <template> <div :style="{height: cesiumContainer}"> <div :id="cesiumId"></div> - <CesiumCompass v-if="viewer && showAnimation" :viewer="viewer" /> + <!-- <CesiumCompass v-if="viewer && showAnimation" :viewer="viewer" /> --> <div id="crosshair" - v-if="showCrosshair" - style=" - position:absolute; - left:50%; - top:50%; - transform:translate(-50%,-50%); - pointer-events:none; /* 涓嶉樆鎸¢紶鏍囦簨浠� */ + v-if="showCrosshair" + style=" + position:absolute; + left:50%; + top:50%; + transform:translate(-50%,-50%); + pointer-events:none; /* 涓嶉樆鎸¢紶鏍囦簨浠� */ - "> - <svg viewBox="0 0 24 24" width="32" height="32" style="color:red;"> - <path d="M12 2v6M12 16v6M2 12h6M16 12h6" - stroke="currentColor" stroke-width="2" stroke-linecap="round"/> - <circle cx="12" cy="12" r="1.5" fill="currentColor"/> - </svg> - </div> + "> + <svg viewBox="0 0 24 24" width="32" height="32" style="color:red;"> + <path d="M12 2v6M12 16v6M2 12h6M16 12h6" + stroke="currentColor" stroke-width="2" stroke-linecap="round"/> + <circle cx="12" cy="12" r="1.5" fill="currentColor"/> + </svg> + </div> </div> </template> @@ -233,6 +233,13 @@ this.viewer = viewer // window.viewer = viewer; window[this.cesiumId].viewer = viewer + window['cesiumContainer'].viewer.extend(Cesium.viewerCesiumNavigationMixin, {}); + // window['cesiumContainer'].viewer.camera.changed.addEventListener(function() { + // var currentHeading = Cesium.Math.toDegrees(window['cesiumContainer'].viewer.camera.heading); + // var currentPitch = Cesium.Math.toDegrees(window['cesiumContainer'].viewer.camera.pitch); + // console.log("瀹炴椂鏈濆悜:", currentHeading, currentPitch); + // // 鍦ㄨ繖閲屾洿鏂颁綘鐨刄I鎴栧彉閲� + // }); this.$emit('mapReady'); }, resizeMap() { @@ -267,4 +274,14 @@ .cesium-viewer-bottom{ display: none; } +#cesiumContainerYY{ + height: 100% !important; +} +#distanceLegendDiv{ + width: 200px; + height: 200px; + position: absolute; + top: 20px; + right: 20px; +} </style> -- Gitblit v1.9.3