소스 검색

标记疑点bug修复 -- 直接关闭标记疑点按钮报错

Bella 2 년 전
부모
커밋
60e700f181
2개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 1
      public/static/plugins/draw-plugin/leaflet.draw.js
  2. 0 2
      src/components/map/MapHolder.vue

+ 3 - 1
public/static/plugins/draw-plugin/leaflet.draw.js

@@ -630,7 +630,9 @@ map2DViewer.setDrawTool = function (options) {
       this.map.off("draw-result", map2DViewer.drawToolFire);
       this.map.off("draw-result", map2DViewer.drawToolFire);
       if (this.measureTool) {
       if (this.measureTool) {
         // 移除绘制的图形
         // 移除绘制的图形
-        this.measureTool._measureGroup.remove();
+        this.measureTool._measureGroup &&
+          this.measureTool._measureGroup.remove();
+
         mousemoveStatus = false;
         mousemoveStatus = false;
         map2DViewer.map.doubleClickZoom.disable();
         map2DViewer.map.doubleClickZoom.disable();
         map2DViewer.map.off("click");
         map2DViewer.map.off("click");

+ 0 - 2
src/components/map/MapHolder.vue

@@ -40,7 +40,6 @@ export default {
     //地图初始化
     //地图初始化
     this.mapInit();
     this.mapInit();
     // 初始化绘制工具
     // 初始化绘制工具
-    // this.initDraw();
     // 可视化区域图
     // 可视化区域图
     this.getJSonData();
     this.getJSonData();
     // 地图常用渲染方法
     // 地图常用渲染方法
@@ -74,7 +73,6 @@ export default {
       if (val.index === 1 && val.subIndex === 1) {
       if (val.index === 1 && val.subIndex === 1) {
         console.log("激活标记疑点弹窗");
         console.log("激活标记疑点弹窗");
         this.initDraw();
         this.initDraw();
-        // this.startLabelCase()
       } else {
       } else {
         console.log("移除疑点标记事件");
         console.log("移除疑点标记事件");
         this.stopLabelCase();
         this.stopLabelCase();