|
@@ -2,11 +2,28 @@
|
|
|
<div id="globalMap">
|
|
|
<div class="global-map">
|
|
|
<MapLogical v-if="activeMap === 'logical'" :map-data="mapData" />
|
|
|
- <!-- <YMap v-else-if="['satellite2', 'satellite3'].includes(activeMap)" :activeMap="activeMap" />-->
|
|
|
- <YztMap v-else-if="['satellite2', 'satellite3'].includes(activeMap)" ref="map2Ref" :active-map="activeMap" :point-type="pointType" />
|
|
|
- <Map v-else ref="mapRef" :active-map="activeMap" :point-type="pointType" @handle-show-video="handleShowVideo" @handleShowWarehouse="handleShowWarehouse" />
|
|
|
+ <!-- <YMap v-else-if="['imageMap', 'satellite2', 'satellite3'].includes(activeMap)" :activeMap="activeMap" />-->
|
|
|
+ <YztMap
|
|
|
+ v-else-if="['imageMap'].includes(activeMap)"
|
|
|
+ ref="map2Ref"
|
|
|
+ :active-map="activeMap"
|
|
|
+ :point-type="pointType"
|
|
|
+ />
|
|
|
+ <Map
|
|
|
+ v-else
|
|
|
+ ref="mapRef"
|
|
|
+ :active-map="activeMap"
|
|
|
+ :point-type="pointType"
|
|
|
+ @handle-show-video="handleShowVideo"
|
|
|
+ @handle-show-warehouse="handleShowWarehouse"
|
|
|
+ />
|
|
|
<!--左侧菜单-->
|
|
|
- <LeftMenu style="position: absolute; top: 20px; left: 20px" @click-menu="clickMenu" @select-search-marker="selectSearchMarker" />
|
|
|
+ <LeftMenu
|
|
|
+ ref="leftMenuRef"
|
|
|
+ style="position: absolute; top: 20px; left: 20px"
|
|
|
+ @click-menu="clickMenu"
|
|
|
+ @select-search-marker="selectSearchMarker"
|
|
|
+ />
|
|
|
<!--右侧菜单-->
|
|
|
<RightMenu ref="rightMenuRef" :point-type="pointType" />
|
|
|
<!--更换地图类型-->
|
|
@@ -15,7 +32,8 @@
|
|
|
<TimeAxis />
|
|
|
<DrawTools v-if="showDrawTools" @handle-analysis-data="handleAnalysisData" />
|
|
|
<NearbyVideos v-if="showNearbyVideos" v-model="showNearbyVideos" :location="location" />
|
|
|
- <MaterialDetail v-if="showWarehouse" v-model="showWarehouse" :warehouseData="warehouseData" />
|
|
|
+ <MaterialDetail v-if="showWarehouse" v-model="showWarehouse" :warehouse-data="warehouseData" />
|
|
|
+ <CommunicationSupport v-if="communicationSupport.show" @close="handleHideCommunicationSupport" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -34,13 +52,19 @@ import { getPointInfo } from '@/api/globalMap';
|
|
|
import RightMenu from './RightMenu/index.vue';
|
|
|
import { PointType } from '@/api/globalMap/type';
|
|
|
import DrawTools from '@/views/globalMap/RightMenu/DrawTools.vue';
|
|
|
+import CommunicationSupport from '@/views/globalMap/RightMenu/CommunicationSupport.vue';
|
|
|
|
|
|
const rightMenuRef = ref(null);
|
|
|
const mapData = reactive(logicalData);
|
|
|
let mapRef = ref(null);
|
|
|
let map2Ref = ref(null);
|
|
|
-// logical vectorgraph satellite satellite2 satellite3
|
|
|
-let activeMap = ref('logical');
|
|
|
+let leftMenuRef = ref(null);
|
|
|
+// vectorgraph satellite imageMap 废弃:logical satellite2 satellite3
|
|
|
+let activeMap = ref('satellite');
|
|
|
+const communicationSupport = reactive({
|
|
|
+ show: false,
|
|
|
+ data: {}
|
|
|
+})
|
|
|
|
|
|
const switchMap = (key) => {
|
|
|
activeMap.value = key;
|
|
@@ -48,7 +72,7 @@ const switchMap = (key) => {
|
|
|
let pointType = ref<PointType[]>([]);
|
|
|
let markerList = ref([]);
|
|
|
const addMarkers = (item) => {
|
|
|
- const dom = activeMap.value === 'satellite2' ? map2Ref.value : mapRef.value;
|
|
|
+ const dom = activeMap.value === 'imageMap' ? map2Ref.value : mapRef.value;
|
|
|
if (dom) {
|
|
|
if (!item.checked) {
|
|
|
let index = pointType.value.findIndex((item2) => item.component === item2.component);
|
|
@@ -96,7 +120,7 @@ const addMarkers = (item) => {
|
|
|
};
|
|
|
// 跳转指定地点
|
|
|
const toAddress = (item) => {
|
|
|
- const dom = activeMap.value === 'satellite2' ? map2Ref.value : mapRef.value;
|
|
|
+ const dom = activeMap.value === 'imageMap' ? map2Ref.value : mapRef.value;
|
|
|
dom.setCenter(item);
|
|
|
};
|
|
|
|
|
@@ -119,11 +143,20 @@ const clickMenu = (item, dataList) => {
|
|
|
if (item.checked || (!item.checked && index === 0)) {
|
|
|
rightMenuRef.value.updateMenu(
|
|
|
checked,
|
|
|
- ['易涝隐患点', '无人机', '铁塔运行监测', '物资与装备', '通讯保障', '手机工作台', '卫星电话'].includes(item.name) ? item : { name: '图层分析', meta: { icon: 'icon1' } }
|
|
|
+ ['易涝隐患点', '无人机', '铁塔运行监测', '物资与装备', '通讯保障', '手机工作台'].includes(item.name)
|
|
|
+ ? item
|
|
|
+ : { name: '图层分析', meta: { icon: 'icon1' } }
|
|
|
);
|
|
|
}
|
|
|
+ } else if (item.path === '3') {
|
|
|
+ communicationSupport.show = !communicationSupport.show;
|
|
|
+ communicationSupport.data = item;
|
|
|
}
|
|
|
};
|
|
|
+const handleHideCommunicationSupport = () => {
|
|
|
+ communicationSupport.show = false;
|
|
|
+ leftMenuRef.value.setMenuChange(communicationSupport.data, false);
|
|
|
+};
|
|
|
const findChecked = (dataList, name) => {
|
|
|
let index = 0;
|
|
|
dataList.forEach((item) => {
|
|
@@ -139,12 +172,21 @@ const findChecked = (dataList, name) => {
|
|
|
};
|
|
|
// 点击搜索结果,添加标注
|
|
|
const selectSearchMarker = (item) => {
|
|
|
- const dom = activeMap.value === 'satellite2' ? map2Ref.value : mapRef.value;
|
|
|
+ const dom = activeMap.value === 'imageMap' ? map2Ref.value : mapRef.value;
|
|
|
let item2 = deepClone(item);
|
|
|
- if (iconList[item.component]) {
|
|
|
- item2.image = iconList[item.component].image;
|
|
|
- item2.size = iconList[item.component].size;
|
|
|
+ // 获取图标
|
|
|
+ if (iconList[item2.dataType]) {
|
|
|
+ item2.icon = iconList[item2.dataType].image;
|
|
|
+ item2.image = iconList[item2.dataType].image;
|
|
|
+ item2.imageHover = iconList[item2.dataType].imageHover;
|
|
|
+ item2.size = iconList[item2.dataType].size;
|
|
|
+ } else {
|
|
|
+ item2.icon = iconList['common'].image;
|
|
|
+ item2.image = iconList['common'].image;
|
|
|
+ item2.imageHover = iconList['common'].imageHover;
|
|
|
+ item2.size = iconList['common'].size;
|
|
|
}
|
|
|
+ item2.lnglat = [item2.longitude, item2.latitude];
|
|
|
dom.addSearchMarker(item2);
|
|
|
};
|
|
|
const handleAnalysisData = (data) => {
|
|
@@ -152,7 +194,7 @@ const handleAnalysisData = (data) => {
|
|
|
};
|
|
|
// 获取地图元素操作
|
|
|
const getMap = () => {
|
|
|
- if (['satellite2', 'satellite3'].includes(activeMap.value)) {
|
|
|
+ if (['imageMap', 'satellite2', 'satellite3'].includes(activeMap.value)) {
|
|
|
return map2Ref.value.getMap();
|
|
|
} else if (['vectorgraph', 'satellite'].includes(activeMap.value)) {
|
|
|
return mapRef.value.getMap();
|
|
@@ -160,7 +202,7 @@ const getMap = () => {
|
|
|
return {};
|
|
|
};
|
|
|
const showDetail = (data, dataType) => {
|
|
|
- if (['satellite2', 'satellite3'].includes(activeMap.value)) {
|
|
|
+ if (['imageMap', 'satellite2', 'satellite3'].includes(activeMap.value)) {
|
|
|
return map2Ref.value.handleHover(data, dataType);
|
|
|
} else if (['vectorgraph', 'satellite'].includes(activeMap.value)) {
|
|
|
return mapRef.value.handleHover(data, dataType);
|
|
@@ -168,7 +210,7 @@ const showDetail = (data, dataType) => {
|
|
|
return {};
|
|
|
};
|
|
|
const getDrawTool = () => {
|
|
|
- if (['satellite2', 'satellite3'].includes(activeMap.value)) {
|
|
|
+ if (['imageMap', 'satellite2', 'satellite3'].includes(activeMap.value)) {
|
|
|
return map2Ref.value.drawTool;
|
|
|
} else if (['vectorgraph', 'satellite'].includes(activeMap.value)) {
|
|
|
return mapRef.value.drawTool;
|
|
@@ -176,13 +218,21 @@ const getDrawTool = () => {
|
|
|
return {};
|
|
|
};
|
|
|
const getMarkers = () => {
|
|
|
- if (['satellite2', 'satellite3'].includes(activeMap.value)) {
|
|
|
+ if (['imageMap', 'satellite2', 'satellite3'].includes(activeMap.value)) {
|
|
|
return map2Ref.value.getMarkers();
|
|
|
} else if (['vectorgraph', 'satellite'].includes(activeMap.value)) {
|
|
|
return mapRef.value.getMarkers();
|
|
|
}
|
|
|
return {};
|
|
|
};
|
|
|
+const trackPlayback = (data) => {
|
|
|
+ if (['imageMap', 'satellite2', 'satellite3'].includes(activeMap.value)) {
|
|
|
+ return map2Ref.value.trackPlayback(data);
|
|
|
+ } else if (['vectorgraph', 'satellite'].includes(activeMap.value)) {
|
|
|
+ return mapRef.value.trackPlayback(data);
|
|
|
+ }
|
|
|
+ return {};
|
|
|
+};
|
|
|
let showNearbyVideos = ref(false);
|
|
|
let location = reactive([]);
|
|
|
// 显示附近视频
|
|
@@ -203,6 +253,7 @@ const handleShowWarehouse = (data) => {
|
|
|
// })
|
|
|
|
|
|
provide('getMap', getMap);
|
|
|
+provide('trackPlayback', trackPlayback);
|
|
|
provide('showDetail', showDetail);
|
|
|
provide('getDrawTool', getDrawTool);
|
|
|
provide('getMarkers', getMarkers);
|