|
@@ -63,6 +63,8 @@ import GridPointRainfall from '@/views/globalMap/RightMenu/GridPointRainfall.vue
|
|
|
import NearbyVideos from '@/components/NearbyVideos/index.vue';
|
|
|
import EmergencyCrew from '@/views/globalMap/RightMenu/EmergencyCrew.vue';
|
|
|
|
|
|
+const AMapType = ['vectorgraph', 'satellite'];
|
|
|
+const YMapType = ['satellite2', 'satellite3', 'imageMap', 'imageMap2'];
|
|
|
const rightMenuRef = ref(null);
|
|
|
const mapData = reactive(logicalData);
|
|
|
let map;
|
|
@@ -88,7 +90,7 @@ const switchMap = (key) => {
|
|
|
let pointType = ref<PointType[]>([]);
|
|
|
let markerList = ref([]);
|
|
|
const addMarkers = (item) => {
|
|
|
- const dom = activeMap.value === 'imageMap' ? map2Ref.value : mapRef.value;
|
|
|
+ const dom = YMapType.includes(activeMap.value) ? map2Ref.value : mapRef.value;
|
|
|
if (dom) {
|
|
|
if (!item.checked) {
|
|
|
let index = pointType.value.findIndex((item2) => item.component === item2.component);
|
|
@@ -215,7 +217,7 @@ const findChecked = (dataList, name) => {
|
|
|
};
|
|
|
// 点击搜索结果,添加标注
|
|
|
const selectSearchMarker = (item) => {
|
|
|
- const dom = activeMap.value === 'imageMap' ? map2Ref.value : mapRef.value;
|
|
|
+ const dom = YMapType.includes(activeMap.value) ? map2Ref.value : mapRef.value;
|
|
|
let item2 = deepClone(item);
|
|
|
// 获取图标
|
|
|
if (iconList[item2.dataType]) {
|
|
@@ -237,57 +239,57 @@ const handleAnalysisData = (data) => {
|
|
|
};
|
|
|
// 获取地图元素操作
|
|
|
const getMap = () => {
|
|
|
- if (['imageMap', 'satellite2', 'satellite3'].includes(activeMap.value)) {
|
|
|
+ if (YMapType.includes(activeMap.value)) {
|
|
|
return map2Ref.value.getMap();
|
|
|
- } else if (['vectorgraph', 'satellite'].includes(activeMap.value)) {
|
|
|
+ } else if (AMapType.includes(activeMap.value)) {
|
|
|
return mapRef.value.getMap();
|
|
|
}
|
|
|
return {};
|
|
|
};
|
|
|
const getMapUtils = () => {
|
|
|
- if (['imageMap', 'satellite2', 'satellite3'].includes(activeMap.value)) {
|
|
|
+ if (YMapType.includes(activeMap.value)) {
|
|
|
return map2Ref.value.getMapUtils();
|
|
|
- } else if (['vectorgraph', 'satellite'].includes(activeMap.value)) {
|
|
|
+ } else if (AMapType.includes(activeMap.value)) {
|
|
|
return mapRef.value.getMapUtils();
|
|
|
}
|
|
|
return {};
|
|
|
};
|
|
|
const showDetail = (data, dataType) => {
|
|
|
- if (['imageMap', 'satellite2', 'satellite3'].includes(activeMap.value)) {
|
|
|
+ if (YMapType.includes(activeMap.value)) {
|
|
|
return map2Ref.value.handleHover(data, dataType);
|
|
|
- } else if (['vectorgraph', 'satellite'].includes(activeMap.value)) {
|
|
|
+ } else if (AMapType.includes(activeMap.value)) {
|
|
|
return mapRef.value.handleHover(data, dataType);
|
|
|
}
|
|
|
return {};
|
|
|
};
|
|
|
const getDrawTool = () => {
|
|
|
- if (['imageMap', 'satellite2', 'satellite3'].includes(activeMap.value)) {
|
|
|
+ if (YMapType.includes(activeMap.value)) {
|
|
|
return map2Ref.value.getMapUtils();
|
|
|
- } else if (['vectorgraph', 'satellite'].includes(activeMap.value)) {
|
|
|
+ } else if (AMapType.includes(activeMap.value)) {
|
|
|
return mapRef.value.drawTool;
|
|
|
}
|
|
|
return {};
|
|
|
};
|
|
|
const getMarkers = () => {
|
|
|
- if (['imageMap', 'satellite2', 'satellite3'].includes(activeMap.value)) {
|
|
|
+ if (YMapType.includes(activeMap.value)) {
|
|
|
return map2Ref.value.getMarkers();
|
|
|
- } else if (['vectorgraph', 'satellite'].includes(activeMap.value)) {
|
|
|
+ } else if (AMapType.includes(activeMap.value)) {
|
|
|
return mapRef.value.getMarkers();
|
|
|
}
|
|
|
return {};
|
|
|
};
|
|
|
const getPlaceSearch = () => {
|
|
|
- if (['imageMap', 'satellite2', 'satellite3'].includes(activeMap.value)) {
|
|
|
+ if (YMapType.includes(activeMap.value)) {
|
|
|
return map2Ref.value.getPlaceSearch();
|
|
|
- } else if (['vectorgraph', 'satellite'].includes(activeMap.value)) {
|
|
|
+ } else if (AMapType.includes(activeMap.value)) {
|
|
|
return mapRef.value.getPlaceSearch();
|
|
|
}
|
|
|
return {};
|
|
|
};
|
|
|
const trackPlayback = (data) => {
|
|
|
- if (['imageMap', 'satellite2', 'satellite3'].includes(activeMap.value)) {
|
|
|
+ if (YMapType.includes(activeMap.value)) {
|
|
|
return map2Ref.value.trackPlayback(data);
|
|
|
- } else if (['vectorgraph', 'satellite'].includes(activeMap.value)) {
|
|
|
+ } else if (AMapType.includes(activeMap.value)) {
|
|
|
return mapRef.value.trackPlayback(data);
|
|
|
}
|
|
|
return {};
|