From e5e65bb50cbfb973f98191993ab559767eff7a53 Mon Sep 17 00:00:00 2001 From: suerprisePlus <15810472099@163.com> Date: 星期二, 30 七月 2024 17:06:34 +0800 Subject: [PATCH] 页面添加(知识图谱,数据统计,数据分析,站点管理) --- src/assets/js/mapSdk/menuManager.js | 80 ++++++++++++++++++++++++++++++++++++++- 1 files changed, 77 insertions(+), 3 deletions(-) diff --git a/src/assets/js/mapSdk/menuManager.js b/src/assets/js/mapSdk/menuManager.js index 523bcab..e2a46a0 100644 --- a/src/assets/js/mapSdk/menuManager.js +++ b/src/assets/js/mapSdk/menuManager.js @@ -1,5 +1,12 @@ + 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 +87,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 +129,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) { @@ -117,7 +191,7 @@ return res.name; break; case 'a2': - return res.name; + earthCtrl.factory.createScreenshot(); break; default: return null; -- Gitblit v1.9.3