瀏覽代碼

地图组件修改

彭宇 2 年之前
父節點
當前提交
3e5e7d3a4e
共有 1 個文件被更改,包括 22 次插入7 次删除
  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);