| | |
| | | watch( |
| | | () => mapCurrentDetail, |
| | | newVal => { |
| | | const newDataMap=JSON.parse(newVal) |
| | | // 只有 workNavigationShow 为 true 且有经纬度时才添加标记 |
| | | if (workNavigationShow && newVal?.longitude && newVal?.latitude) { |
| | | addIncidentMarker(newVal) |
| | | mapCurrentDetailData.value = newVal |
| | | if (workNavigationShow && newDataMap?.longitude && newDataMap?.latitude) { |
| | | addIncidentMarker(newDataMap) |
| | | mapCurrentDetailData.value = newDataMap |
| | | } else if (!workNavigationShow && incidentMarker) { |
| | | // 当 workNavigationShow 变为 false 时,移除已添加的标记 |
| | | markersLayer.removeLayer(incidentMarker) |