瀏覽代碼

高德地图调整

Hwf 4 月之前
父節點
當前提交
23141479b3
共有 2 個文件被更改,包括 7 次插入5 次删除
  1. 6 4
      src/hooks/AMap/useAMap.ts
  2. 1 1
      src/views/globalMap/index.vue

+ 6 - 4
src/hooks/AMap/useAMap.ts

@@ -310,12 +310,13 @@ export function useAMap(options) {
           const polygonPath = feature.geometry.coordinates[0].map((coord) => {
             return [coord[0], coord[1]];
           });
-          const polygon = new AMap.Polygon({
+          const polygon = new AMap.Polyline({
             path: polygonPath,
             strokeColor: option.strokeColor ? option.strokeColor : '#268ab9',
             strokeOpacity: option.strokeOpacity ? option.strokeOpacity : 1,
             strokeWeight: option.strokeWeight ? option.strokeWeight : 1,
-            fillOpacity: 0
+            fillOpacity: 0,
+            clickable: false
           });
           maskPolygon2.push(polygon);
           map.add(polygon);
@@ -328,13 +329,14 @@ export function useAMap(options) {
             });
             const outerPath = polygonPath[0];
             const innerPaths = polygonPath.slice(1);
-            const polygon = new AMap.Polygon({
+            const polygon = new AMap.Polyline({
               path: outerPath,
               holes: innerPaths,
               strokeColor: option.strokeColor ? option.strokeColor : '#268ab9',
               strokeOpacity: option.strokeOpacity ? option.strokeOpacity : 1,
               strokeWeight: option.strokeWeight ? option.strokeWeight : 1,
-              fillOpacity: 0
+              fillOpacity: 0,
+              clickable: false
             });
             maskPolygon2.push(polygon);
             map.add(polygon);

+ 1 - 1
src/views/globalMap/index.vue

@@ -70,7 +70,7 @@ let map2Ref = ref(null);
 let leftMenuRef = ref(null);
 let showMask = ref(true);
 //  vectorgraph satellite imageMap imageMap3 logical satellite2 satellite3
-let activeMap = ref('imageMap');
+let activeMap = ref('satellite');
 // 附近视频菜单数据
 let tempMenu = ref({
   name: '',