Browse Source

地图组件修改

彭宇 2 years ago
parent
commit
3e5e7d3a4e
1 changed files with 22 additions and 7 deletions
  1. 22 7
      src/components/supermap.vue

+ 22 - 7
src/components/supermap.vue

@@ -365,10 +365,17 @@
             }
           }
           if (markersList[i].click != null && markersList[i].click !== "") {
-            markerClick.on('click', function () {
-              let clickName = markersList[i].click;
-              _that.$emit(clickName);
-            })
+            if(markersList[i].parameter != null && markersList[i].parameter !== ""){
+              markerClick.on('click', function () {
+                let clickName = markersList[i].click;
+                _that.$emit(clickName,markersList[i].parameter);
+              })
+            }else{
+              markerClick.on('click', function () {
+                let clickName = markersList[i].click;
+                _that.$emit(clickName);
+              })
+            }
           }
           if (isAggregation) {
             _that.isAggregationLayers.addLayer(markerClick)
@@ -417,9 +424,17 @@
             }
           }
           if (markersList[i].click != null && markersList[i].click != "") {
-            marker.on('click', function () {
-              _that.$emit(markersList[i].click);
-            })
+            if(markersList[i].parameter != null && markersList[i].parameter !== ""){
+              marker.on('click', function () {
+                let clickName = markersList[i].click;
+                _that.$emit(clickName,markersList[i].parameter);
+              })
+            }else{
+              marker.on('click', function () {
+                let clickName = markersList[i].click;
+                _that.$emit(clickName);
+              })
+            }
           }
           marker.addTo(this.map);