Browse Source

Merge branch 'master' of http://192.168.50.233:3000/rui.jiang/performance-test

liujiejie 5 months ago
parent
commit
71cd267cb0
3 changed files with 4 additions and 1 deletions
  1. BIN
      src/assets/img/iconFJ.png
  2. BIN
      src/assets/img/iconFJ1.png
  3. 4 1
      src/components/map/index.vue

BIN
src/assets/img/iconFJ.png


BIN
src/assets/img/iconFJ1.png


+ 4 - 1
src/components/map/index.vue

@@ -270,22 +270,25 @@ export default {
       const source = layer.getSource();
 
       const iconSrc = this.getIconForValue(data.val);
+      const scale = data.val === "4" ? [0.5, 0.5] : [0.3, 0.3]; // 如果是 icon04,设置 scale 为 [0.5, 0.5],其他保持 [0.3, 0.3]
 
       const feature = new Feature({
         geometry: new Point(fromLonLat(data.point, "EPSG:4326")),
         name: "marker",
         data,
       });
+
       feature.setStyle(
         new Style({
           image: new Icon({
             src: iconSrc,
-            scale: [0.3, 0.3],
+            scale: scale, // 根据条件动态设置 scale
             anchor: [0.5, 1],
             opacity: 1,
           }),
         })
       );
+
       source.addFeature(feature);
     },
     /**