预警因素
@@ -221,37 +228,32 @@ export default {
this.map.getPane("mapLayer1").style.zIndex = 501;
this.map.getPane("mapLayer1").style.pointerEvents = "none";
- // this.map.createPane("mapLayer2");
- // this.map.getPane("mapLayer2").style.zIndex = 501;
- // this.map.getPane("mapLayer2").style.pointerEvents = "none";
-
- // this.map.createPane("mapLayer3");
- // this.map.getPane("mapLayer3").style.zIndex = 501;
- // this.map.getPane("mapLayer3").style.pointerEvents = "none";
-
- // this.map.createPane("mapLayer4");
- // this.map.getPane("mapLayer4").style.zIndex = 501;
- // this.map.getPane("mapLayer4").style.pointerEvents = "none";
-
- // this.map.createPane("mapLayer5");
- // this.map.getPane("mapLayer5").style.zIndex = 501;
- // this.map.getPane("mapLayer5").style.pointerEvents = "none";
-
this.mapLayers.mapLayer1 = L.featureGroup().addTo(this.map);
- // this.mapLayers.mapLayer2 = L.featureGroup().addTo(this.map);
- // this.mapLayers.mapLayer3 = L.featureGroup().addTo(this.map);
- // this.mapLayers.mapLayer4 = L.featureGroup().addTo(this.map);
- // this.mapLayers.mapLayer5 = L.featureGroup().addTo(this.map);
-
- // this.getPosition();
},
getList(id){
this.loading = true;
auditList(id).then(res=>{
this.audioInfo = {...res.data.records[0]};
if(this.audioInfo.caseLnglat) {
+ let iconUrl2 = require("@/assets/images/icon2.png");
// 事件有经纬度情况下
-
+ var myIcon2 = L.icon({
+ iconUrl: iconUrl2,
+ iconSize: [38, 50], // 图标图像的尺寸,单位是像素。
+ iconAnchor: [19, 29], // 图标 "tip" 的坐标(相对于其左上角)。图标将被对齐,使该点位于标记的地理位置。如果指定了尺寸,默认为居中,也可以在CSS中设置负的边距。
+ popupAnchor: [-3, -76], // 弹出窗口(popup)的坐标,相对于图标锚点而言,将从该点打开。
+ });
+ let lat = this.audioInfo.caseLnglat.split(",")[1];
+ let lon = this.audioInfo.caseLnglat.split(",")[0];
+ let marker = L.marker(
+ L.latLng(lat, lon),
+ { icon: myIcon2 }
+ )
+ // .addTo(this.mapLayers.mapLayer1)
+ this.mapLayers.mapLayer1.addLayer(marker);
+ const bounds = this.mapLayers.mapLayer1.getBounds();
+ let center = bounds.getCenter();
+ this.map.setView(center, 12);
}
this.loading = false;
}).catch(err=>{
diff --git a/src/views/warningManage/warningAppear.vue b/src/views/warningManage/warningAppear.vue
index 1348429..57a855c 100644
--- a/src/views/warningManage/warningAppear.vue
+++ b/src/views/warningManage/warningAppear.vue
@@ -20,7 +20,7 @@
-
{{ item.title }}
+
{{ item.warnFactor }}
@@ -28,11 +28,11 @@