From f76b96c26b878840ecc80b79d1e28e477d5573e6 Mon Sep 17 00:00:00 2001 From: suerprisePlus <15810472099@163.com> Date: 星期一, 01 七月 2024 18:10:25 +0800 Subject: [PATCH] 模型发布管理 添加 --- src/assets/js/mapSdk/menuManager.js | 77 +++++++++++++++++++++++++++++++++++++- 1 files changed, 75 insertions(+), 2 deletions(-) diff --git a/src/assets/js/mapSdk/menuManager.js b/src/assets/js/mapSdk/menuManager.js index 523bcab..caf3ce7 100644 --- a/src/assets/js/mapSdk/menuManager.js +++ b/src/assets/js/mapSdk/menuManager.js @@ -1,5 +1,11 @@ const menuManager = { pid: null, + pointFly: null, + colorAll: { + point: SmartEarth.Cesium.Color.fromCssColorString('#ff0000'), + polyline: SmartEarth.Cesium.Color.fromCssColorString('#ffff0050'), + polygon: SmartEarth.Cesium.Color.fromCssColorString('#ffff0050'), + }, init(res) { switch (res.pid) { case 's1': //閰嶇綉宸℃ @@ -80,12 +86,30 @@ setMenuS5(res) { switch (res.id) { case 'a1': - case 'a3': + if (this.pointFly) { + this.pointFly.removeFromMap(); + } else { + earthCtrl.factory.createSimpleGraphic('billboard', {}, (entity) => { + const position = entity.position.getValue(); + const coordinate = earthCtrl.core.toDegrees(position); + this.pointFly = earthCtrl.camera.rotateCamera({ + lon: coordinate.lon, + lat: coordinate.lat, + distance: 1000, + pitch: -30, + }); + }); + } return null; break; case 'a2': return res.name; break; + case 'a3': + earthCtrl.analysis.createIndoormode({ showHelp: true }); + return null; + break; + default: return null; break; @@ -104,11 +128,60 @@ }, // 鏍囩粯 setMenuS7(res) { + switch (res.id) { + case 'a1': + earthCtrl.factory.createSimpleGraphic('point', {}, (entity) => {}); + break; + case 'a2': + earthCtrl.factory.createSimpleGraphic('label', {}, (entity) => {}); + break; + case 'a3': + earthCtrl.factory.createSimpleGraphic('polyline', { showSize: false }, (entity) => {}); + break; + case 'a4': + earthCtrl.factory.createSimpleGraphic('rectangle', { showSize: false }, (entity) => {}); + break; + case 'a5': + earthCtrl.factory.createSimpleGraphic('polygon', { showSize: false }, (entity) => {}); + break; + case 'a6': + earthCtrl.factory.SimpleGraphic.clear(); + break; + default: + break; + } return null; }, // 娴嬮噺 setMenuS8(res) { - return null; + const colorAll = this.colorAll; + switch (res.id) { + case 'a1': + earthCtrl.measure.clampLineDistance(colorAll, (e) => {}); + break; + case 'a2': + earthCtrl.measure.altitude(colorAll, (e) => {}); + break; + case 'a3': + earthCtrl.measure.surfaceArea( + { + ...colorAll, + tin: true, // 鏄惁鏄剧ずtin涓夎缃� + onlyTerrain: false, // 鏄惁鍙祴閲忕簿缁嗗湴褰� + }, + (e) => {} + ); + break; + case 'a4': + earthCtrl.measure.planeArea(colorAll, (e) => {}); + break; + case 'a5': + earthCtrl.measure.horizontalDistance(colorAll, (e) => {}); + break; + case 'a6': + earthCtrl.measure.clearResult(); + break; + } }, // 鐗规晥 setMenuS9(res) { -- Gitblit v1.9.3