diff --git a/src/assets/mapUtils/map.ts b/src/assets/mapUtils/map.ts index 8e5db10..5087991 100644 --- a/src/assets/mapUtils/map.ts +++ b/src/assets/mapUtils/map.ts @@ -25,6 +25,8 @@ export const Map = { driving: null, walking: null, mapDriverOrWalkLoading: false, + layerGroup: null, + layerData: null, /** * @desc 地图舒适化 * @param el dom元素 id选择器 @@ -60,6 +62,18 @@ export const Map = { this.drawOutLine(); } }); + const satellite = new AMap.TileLayer.Satellite({ + zIndex: 11, + }); + + const roadNet = new AMap.TileLayer.RoadNet({ + zIndex: 12, + }); + this.layerData = { satellite, roadNet }; + this.layerGroup = new AMap.LayerGroup([satellite, roadNet]); + this.layerGroup.setMap(this.map); + satellite.hide(); + roadNet.hide(); resolve(); }); }); diff --git a/src/views/indexSun.vue b/src/views/indexSun.vue index 3d0a0c5..9c0004d 100644 --- a/src/views/indexSun.vue +++ b/src/views/indexSun.vue @@ -64,7 +64,7 @@ />
- +
@@ -99,7 +99,10 @@ + @@ -200,6 +203,7 @@ const showMapBottom = ref(false); const userData = ref({}); const centerMapRef = ref(); + const twoNewR = ref(); const otherLoading = ref(false); onMounted(() => { @@ -225,6 +229,10 @@ } }); + function openRBModal(item: any) { + twoNewR.value.handlePolice(item); + } + const getTime = () => { dateInfo.value = { day: dayjs().format('YYYY年MM月DD日'), @@ -238,7 +246,7 @@ } ); - async function forHelp(record: any) { + async function forHelp(record: any, showBottomInfo = true) { indexModalRef.value.closeDialog(); record['lat'] = record?.latitude; record['lon'] = record?.longitude; @@ -260,7 +268,7 @@ showRestB.value = false; userData.value = record; } - await confirmHelp(record); + await confirmHelp(record, showBottomInfo); } function toOther() { @@ -399,7 +407,7 @@ const hospitalList = ref([]); //医院列表 const showHospitalList = ref(false); - async function confirmHelp(data: any) { + async function confirmHelp(data: any, showBottomInfo = true) { showMapBottom.value = false; Map.driveLine && Map.driveLine.clear(); try { @@ -414,7 +422,7 @@ userData.value = data; if (!data.lon || !data.lat) { centerMapRef.value.newResetMap(); - showMapBottom.value = data?.emergencyType != 2; + showMapBottom.value = data?.emergencyType != 2 && showBottomInfo; return; } Map.removeOverlayGroup(); diff --git a/src/views/indexSun/centerMap.vue b/src/views/indexSun/centerMap.vue index daf437e..1353443 100644 --- a/src/views/indexSun/centerMap.vue +++ b/src/views/indexSun/centerMap.vue @@ -72,6 +72,14 @@
未获取到当前求助信息的位置信息
+ +
+ + 默认地图 + 卫星地图 + 标准地图 + +