shuhao 5 kuukautta sitten
vanhempi
commit
3b9d9af4cc
2 muutettua tiedostoa jossa 5 lisäystä ja 9 poistoa
  1. 2 1
      src/utils/ol-map/Map.js
  2. 3 8
      src/views/authentic/authenticMap.js

+ 2 - 1
src/utils/ol-map/Map.js

@@ -164,7 +164,7 @@ class Map {
 	initDraw(callback){
 		const vm = this
 		this.draw = new Draw({
-			type: 'Polygon',
+			type: 'MultiPolygon',
 			source: this.polygonLayer.source,
 			free: true,
 			style: vm.drawStyleFunc
@@ -185,6 +185,7 @@ class Map {
 		this.modify = new Modify({
 			source: this.polygonLayer.source,
 			condition:condition || function(){return true;},
+			insertVertexCondition:condition || function(){return true;},
 			pixelTolerance: 10, //设置吸附像素值
 
 		})

+ 3 - 8
src/views/authentic/authenticMap.js

@@ -220,22 +220,15 @@ class AuthenticMap {
   // 清空单个数据
   clearMapData(name, val, id) {
     name && (mapData[name] = val);
-    resetMapData()
     this.clickPointLayer.source.forEachFeature((feature) => {
-      if (feature.get("id") === id) {
         feature.set("icon", "point");
         feature.set("iconBg", "name-bg");
-      }
     });
     const points = this.kmap.getLayerFeatures();
     points.forEach((feature) => {
-      if (feature.get("id") === id) {
         feature.set("icon", "point");
-        this.kmap.polygonStyle(feature);
-        mapData.isPointHide = feature;
-      }
     });
-    mapData.selectPointArr = [];
+    resetMapData()
   }
   //全选
   allSelect(ids){
@@ -276,10 +269,12 @@ class AuthenticMap {
     let that = this;
     that.kmap.on("singleclick", (evt) => {
       if(mapData.curPointData.id && !mapData.disabledForm){
+        console.log(mapData)
         ElMessage.warning("编辑中")
         return;
       }
       if(!mapData.curPointData.id && mapData.isEdit){
+        console.log(mapData)
         ElMessage.warning("编辑中")
         return;
       }