shuishen
2021-06-18 d12e030d8a7690d79c5786bc2a786b6c21a24433
widgets/slope/Widget.js
@@ -24,15 +24,15 @@
            },
            beginSlope: function () {
                console.log('beginSlope');
                // console.log('beginSlope');
                var that = this;
                var viewer = that.map;
                var scene = viewer.scene;
                scene.globe.enableLighting = true;
                //添加SuperMap iServer发布的影像服务
                viewer.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({
                    url: 'http://www.supermapol.com/realspace/services/3D-ZF_normal/rest/realspace/datas/image'
                }));
                // viewer.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({
                //     url: 'http://www.supermapol.com/realspace/services/3D-ZF_normal/rest/realspace/datas/image'
                // }));
                // viewer.scene.camera.setView({
                //     destination: Cesium.Cartesian3.fromDegrees(87.1, 27.8, 8000.0),
                //     orientation: {
@@ -54,7 +54,7 @@
                var wide;
                wide = Cesium.HypsometricSettingEnum.AnalysisRegionMode.ARM_REGION;
                slope.ColorTable = colorTable;
                slope.Opacity = 0.5;
                slope.Opacity = 1;
                function createTooltip(frameDiv) {//创建需要的函数
@@ -154,12 +154,18 @@
                });
                handlerPolygon.activate();
                document.getElementById("cance").onclick = function () {
                    // console.log('cance')
                    viewer.scene.globe.SlopeSetting = {
                        slopeSetting: slope,
                        analysisMode: Cesium.HypsometricSettingEnum.AnalysisRegionMode.ARM_NONE
                    };
                    handlerPolygon.polygon.show = false;
                    handlerPolygon.polyline.show = false;
                    scene.globe.enableLighting = false;
                    //关闭该绘画图层
                    // handlerPolygon.clear();
                };
                viewer._cesiumWidget._creditContainer.style.display = "none";
                $("#split").on("click", function () {
@@ -233,13 +239,13 @@
                    };
                }
                )
                $("#colorTable1").on("input change", function () {
                $("#colorTable12").on("input change", function () {
                    colorTable.remove(0);
                    colorTable.remove(20);
                    colorTable.remove(30);
                    colorTable.remove(50);
                    colorTable.remove(80);
                    var value = document.getElementById("colorTable1").selectedIndex;
                    var value = document.getElementById("colorTable12").selectedIndex;
                    switch (value) {
                        case 0:
                            colorTable.insert(0, new Cesium.Color(9 / 255, 9 / 255, 255 / 255));
@@ -292,6 +298,26 @@
                $('#toolbar').show();
                $('#btnContainer').show();
                $('#loadingbar').remove();
                that.handlerPolygon = handlerPolygon;
                that.viewer = viewer;
                that.scene = scene;
                that.slope = slope;
                topic.subscribe("closes", lang.hitch(this, this.closes));
            },
            handlerPolygon: '',
            viewer: '',
            scene: '',
            closes: function () {
                // 关闭绘画层
                this.viewer.scene.globe.SlopeSetting = {
                    slopeSetting: this.slope,
                    analysisMode: Cesium.HypsometricSettingEnum.AnalysisRegionMode.ARM_NONE
                };
                // handlerPolygon.polygon.show = false;
                // handlerPolygon.polyline.show = false;
                this.scene.globe.enableLighting = false;
                this.handlerPolygon.clear();
            },
            onOpen: function () {