修改 地图显示逻辑

This commit is contained in:
GGJ
2024-12-13 15:57:41 +08:00
parent ce34572df5
commit 0cd5598e8c
2 changed files with 13 additions and 8 deletions

View File

@@ -45,14 +45,16 @@
<bm-map-type :map-types="['BMAP_NORMAL_MAP', 'BMAP_HYBRID_MAP']" <bm-map-type :map-types="['BMAP_NORMAL_MAP', 'BMAP_HYBRID_MAP']"
anchor='BMAP_ANCHOR_TOP_RIGHT'></bm-map-type> anchor='BMAP_ANCHOR_TOP_RIGHT'></bm-map-type>
<!-- 线--> <!-- 线-->
<div v-if='zoom > 13'>
<bm-polyline :path='path' v-for='(path, index) in polyline' :key='index'></bm-polyline> <bm-polyline :path='path' v-for='(path, index) in polyline' :key='index'></bm-polyline>
</div>
<!-- 变电站--> <!-- 变电站-->
<template v-if='zoom > 12'> <template v-if='zoom > 13'>
<bm-marker :position='path' v-for='path in siteList' :key='path.subId' :icon='path.icon' <bm-marker :position='path' v-for='path in siteList' :key='path.subId' :icon='path.icon'
@click='markerClick(path)'></bm-marker> @click='markerClick(path)'></bm-marker>
</template> </template>
<!-- 点 --> <!-- 点 -->
<BmlMarkerClusterer> <BmlMarkerClusterer maxZoom='12'>
<bm-marker :position='path' v-for='path in areaLineInfo' :key='path.lineId' :icon='path.icon' <bm-marker :position='path' v-for='path in areaLineInfo' :key='path.lineId' :icon='path.icon'
@click='markerClick(path)'></bm-marker> @click='markerClick(path)'></bm-marker>
</BmlMarkerClusterer> </BmlMarkerClusterer>
@@ -145,7 +147,7 @@ const handler = async ({ BMap, map }: any) => {
params.value.searchEndTime = datePickerRef.value.timeValue[1] params.value.searchEndTime = datePickerRef.value.timeValue[1]
let { data } = await getAreaLineInfo(params.value) let { data } = await getAreaLineInfo(params.value)
let r = 0.0035 let r = 0.0035
let list= data.filter((item: any) => item.lng != 0) let list = data.filter((item: any) => item.lng != 0)
list.forEach((item: any) => { list.forEach((item: any) => {
// 变电站图标 // 变电站图标
item.icon = { item.icon = {

View File

@@ -73,9 +73,12 @@
anchor='BMAP_ANCHOR_TOP_RIGHT' anchor='BMAP_ANCHOR_TOP_RIGHT'
></bm-map-type> ></bm-map-type>
<!-- 线--> <!-- 线-->
<div v-if='zoom > 13'>
<bm-polyline :path='path' v-for='(path, index) in polyline' :key='index'></bm-polyline> <bm-polyline :path='path' v-for='(path, index) in polyline' :key='index'></bm-polyline>
</div>
<!-- 变电站--> <!-- 变电站-->
<template v-if='zoom > 12'> <template v-if='zoom > 13'>
<bm-marker <bm-marker
:position='path' :position='path'
v-for='path in siteList' v-for='path in siteList'
@@ -85,7 +88,7 @@
></bm-marker> ></bm-marker>
</template> </template>
<!-- 点 --> <!-- 点 -->
<BmlMarkerClusterer> <BmlMarkerClusterer maxZoom='12'>
<bm-marker <bm-marker
:position='path' :position='path'
v-for='path in areaLineInfo' v-for='path in areaLineInfo'