|
@@ -97,6 +97,7 @@
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
import "./map/mockFarmLayer";
|
|
import "./map/mockFarmLayer";
|
|
|
|
+import StaticMapLayers from "@/components/static_map_change/Layers.js"
|
|
import { onMounted, ref } from "vue";
|
|
import { onMounted, ref } from "vue";
|
|
import fnHeader from "@/components/fnHeader.vue";
|
|
import fnHeader from "@/components/fnHeader.vue";
|
|
import WarningMap from "./warningMap";
|
|
import WarningMap from "./warningMap";
|
|
@@ -122,14 +123,19 @@ const warningLayers = ref({})
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
warningMap.initMap(store.getters.userinfo.location, mapRef.value);
|
|
warningMap.initMap(store.getters.userinfo.location, mapRef.value);
|
|
alarmLayer = new AlarmLayer(warningMap.kmap);
|
|
alarmLayer = new AlarmLayer(warningMap.kmap);
|
|
|
|
+ new StaticMapLayers(warningMap.kmap);
|
|
|
|
|
|
// 图例数据
|
|
// 图例数据
|
|
eventBus.on("alarmList:warningLayers", (data) => {
|
|
eventBus.on("alarmList:warningLayers", (data) => {
|
|
warningLayers.value = data
|
|
warningLayers.value = data
|
|
});
|
|
});
|
|
|
|
|
|
- eventBus.on("alarmList:changeMapLayer", ({name}) => {
|
|
|
|
|
|
+ eventBus.on("alarmList:changeMapLayer", ({name, legendUrl}) => {
|
|
|
|
+ if(legendUrl){
|
|
|
|
+ legendImg.value = legendUrl;
|
|
|
|
+ }else{
|
|
legendImg.value = warningLayers.value[`${name}图例`];
|
|
legendImg.value = warningLayers.value[`${name}图例`];
|
|
|
|
+ }
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
|