소스 검색

状态栏

DESKTOP-CRQ4N2U\jintian 1 년 전
부모
커밋
c2648f84aa
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      src/jtMap3d/Widgets/StatusBar.js

+ 5 - 1
src/jtMap3d/Widgets/StatusBar.js

@@ -131,10 +131,14 @@ class StatusBar {
 		const $this = this
 		this._handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas)
 		const mouseOverHandler = function(movement) {
-			
+
 			/* 识别屏幕位置 */
 			let loc = $this._getScreenClickPositionAndHeight(movement.endPosition);
 
+			if (!Cesium.defined(loc)) return;
+
+			if (!loc.lng) return;
+
 			$this._posX = loc.lng.toFixed(8);
 			$this._posY = loc.lat.toFixed(8);
 			$this._posZ = loc.height.toFixed(2);