木星 4 months ago
parent
commit
a1c393f1e0
1 changed files with 16 additions and 2 deletions
  1. 16 2
      src/views/info/areaInfo/index.vue

+ 16 - 2
src/views/info/areaInfo/index.vue

@@ -190,6 +190,19 @@ export default {
190 190
   methods: {
191 191
 
192 192
     openPolygonTool() {
193
+
194
+      if (  JSON.parse(this.form.location).coordinates[0].length > 0 || this.geoJson.coordinates[0].length > 0 ) {
195
+
196
+        this.$notify({
197
+          title: '警告',
198
+          message: '请先清空地图',
199
+          type: 'warning'
200
+        });
201
+        return
202
+      }else{
203
+  
204
+      }
205
+
193 206
       if (this.handler) this.handler.close();
194 207
       this.handler = new T.PolygonTool(this.map);
195 208
       this.handler.open();
@@ -221,6 +234,7 @@ export default {
221 234
  destructionTMap ()  {
222 235
   if (this.map) {
223 236
     this.map = null;
237
+    this.geoJson.coordinates[0]=[]
224 238
     // 直接将节点给删掉
225 239
     console.log('1qsad');
226 240
     
@@ -237,9 +251,9 @@ export default {
237 251
 
238 252
 
239 253
     clearmian() {
240
-      this.form.location = null
254
+   
241 255
       this.geoJson.coordinates[0] = []
242
-      this.$set(this.form, 'location', null)
256
+      this.$set(this.form, 'location', JSON.stringify(this.geoJson))
243 257
       this.map.clearOverLays()
244 258
 
245 259