赣州市洪水风险预警系统三维版本
widgets/FloodAnalysis/Widget.js
@@ -49,8 +49,7 @@
            this.map.scene.globe.depthTestAgainstTerrain = true;
            //取消双击事件
            this.map.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
            //绘制水面事件
            $("#flood_hzsm_headtab").click(function () {
               DrawDynamicClampGround.startDrawingPolyline(self.map, function (cartesians) {
                  if (self.drawingPolyline != undefined)
@@ -67,12 +66,14 @@
                  cartesians.splice(cartesians.length - 1, cartesians.length);
                  self.drawLines(cartesians);
                  self.movehandLer()
                  self.showDetail(true)
               });
            });
            $('#flood_qcsmx_headtab').click(function () {
               self.map.entities.remove(self.drawingPolyline);
               self.map.scene.primitives.remove(self.riverPrimitive);
               self.showDetail(false)
            })
@@ -96,6 +97,9 @@
            // $("#thematic_smxj_headtab").click(function () {
            //    self.offsetHeight(-Number($("#thematic_bhz_headtab").val()), 5);
            // });
            $('#flood-detail-ksfx').click(function () {
               self.floodAnalysisPopup()
            })
         },
@@ -111,7 +115,6 @@
         prepareVertex: function () {
            if (this.positions.length > 0) {
               this.sideRes = this._lines2Plane(this.positions, this.riverWidth, this.riverHeight);
               console.log(this.sideRes,"----000----")
            }
         },
         setPositions: function (e) {
@@ -312,6 +315,12 @@
            $($('div.cesium-viewer').find('.cesium-baseLayerPicker-choices')[0]).children('div:eq(0)').trigger('click');
            $($('div.cesium-viewer').find('.cesium-baseLayerPicker-choices')[1]).children('div:eq(2)').trigger('click');
            this.map.camera.flyTo({
               destination: Cesium.Cartesian3.fromDegrees(116.021604,25.893668, 50000),
            });
            this.showDetail(false)
         },
         onClose: function () {
@@ -440,8 +449,8 @@
         //点击事件
         clickHand:function (click){
            var pickedObjects = this.map.scene.pick(click.position);
            if (pickedObjects.primitive instanceof Cesium.Primitive) {
               this.canvasToImage()
            if (pickedObjects && pickedObjects.primitive instanceof Cesium.Primitive) {
               // this.canvasToImage()
               this.floodAnalysisPopup()
            }
         },
@@ -460,14 +469,16 @@
                  inPolygon.push(this.peoplePositionArray[i])
               }
            }
            var jsonStr = JSON.stringify(inPolygon)
            layer.open({
               title:'模拟分析',
               title:'评估分析',
               type: 2,
               maxmin: false, //开启最大化最小化按钮
               area: ['1100px', '600px'],
               skin: 'floodAnalysis',
               offset: [top, left],
               content: urlEvaluate,
               content: urlEvaluate + "?data=" + encodeURIComponent(jsonStr),//使用encodeURIComponent转码,避免中文字符乱码,避免url截取错误
               id: "floodAnalysisLayer",
               closeBtn: 1,
               //把父页面数据传递给子弹窗并渲染
@@ -476,7 +487,6 @@
                  var body = layer.getChildFrame("body",index);
                  //得到iframe页的窗口对象
                  var iframeWin = window[layero.find('iframe')[0]['name']];
                  console.log(iframeWin)
                  // //渲染子页面中的img
                  // iframeWin.$('#canvasImage')[0].src = self.canvasImage;
                  var table = ""
@@ -513,6 +523,15 @@
         addPoint:function (){
            const url = './widgets/FloodAnalysis/data.json'
            this.getJsonUrl(url)
         },
         showDetail:function(show){
            //显示详情
            if (show){
               $('.flood-detail').show()
            }else {
               $('.flood-detail').hide()
            }
         },
         //判断点是否在多边形内部
@@ -589,7 +608,7 @@
            u8arr[n] = bstr.charCodeAt(n);
         }
         return new Blob([u8arr], { type: mime });
      }
      },
      });