suerprisePlus
2024-07-01 f76b96c26b878840ecc80b79d1e28e477d5573e6
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) {