|
@@ -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);
|
|
|
},
|
|
|
/**
|