浏览代码

绘制范围问题排查,不能清除问题解决

maxiaoxiao 7 月之前
父节点
当前提交
95c644c7ca
共有 2 个文件被更改,包括 20 次插入19 次删除
  1. 19 19
      src/common/js/common.js
  2. 1 0
      src/components/mapView/range.vue

+ 19 - 19
src/common/js/common.js

@@ -127,25 +127,25 @@ const handlerDrawing = function (PolyType, tooltipNum) { //(传入操作的Dra
                 // that.regions.push(that.regions[0]);
 
                 viewer.entities.removeAll();
-                let polygonEntity = new Cesium.Entity({
-                    id: "polygon",
-                    // position: Cesium.Cartesian3.fromDegreesArray([
-                    //   centerX,
-                    //   centerY,
-                    // ]),
-                    // classificationType: ClassificationType.TERRAIN,
-                    polygon: {
-                        hierarchy: new Cesium.PolygonHierarchy(
-                            new Cesium.Cartesian3.fromDegreesArray(nPositions)
-                        ),
-                        // positions: new Cesium.Cartesian3.fromDegreesArray(positions),
-                        material: Cesium.Color.WHITE.withAlpha(0.3),
-                        outline: true,
-                        outlineColor: Cesium.Color.RED,
-                        outlineWidth: 4,
-                    },
-                });
-                viewer.entities.add(polygonEntity);
+                // let polygonEntity = new Cesium.Entity({
+                //     id: "polygon",
+                //     // position: Cesium.Cartesian3.fromDegreesArray([
+                //     //   centerX,
+                //     //   centerY,
+                //     // ]),
+                //     // classificationType: ClassificationType.TERRAIN,
+                //     polygon: {
+                //         hierarchy: new Cesium.PolygonHierarchy(
+                //             new Cesium.Cartesian3.fromDegreesArray(nPositions)
+                //         ),
+                //         // positions: new Cesium.Cartesian3.fromDegreesArray(positions),
+                //         material: Cesium.Color.WHITE.withAlpha(0.3),
+                //         outline: true,
+                //         outlineColor: Cesium.Color.RED,
+                //         outlineWidth: 4,
+                //     },
+                // });
+                // viewer.entities.add(polygonEntity);
             }
             let positions = cartographic(result.object.positions)
             tooltip.setVisible(false);

+ 1 - 0
src/components/mapView/range.vue

@@ -256,6 +256,7 @@ export default {
               this.model.xzmj = (res.data.area * 0.0015).toFixed(2);
               this.model.xzfw = res.data.id;
               this.model.geom = res.data.geom;
+              this.addPolygon(parse(res.data.geom));
               this.$message({
                 message: "绘制成功!",
                 type: "success",