Refine map tile updates and enhance performance

- Updated tile freshness animation to reduce flicker and improve visual clarity.
- Modified MapView component to optimize layer visibility handling and ensure proper map resizing on fullscreen toggle.
- Increased tile buffer size in map initialization for better tile loading efficiency.
- Implemented logic to limit tile updates to only visible tiles, enhancing rendering performance during map updates.
This commit is contained in:
2026-03-01 17:40:43 +03:00
parent 49af08c13f
commit 8331473808
5 changed files with 48 additions and 21 deletions

View File

@@ -439,13 +439,21 @@ onMounted(async () => {
;(mapInit.coordLayer.options as { visible?: boolean }).visible = v
mapInit.coordLayer.setOpacity(v ? 1 : 0)
mapInit.coordLayer.redraw?.()
if (v && leafletMap) {
mapInit.coordLayer.bringToFront?.()
leafletMap.invalidateSize()
}
if (v) mapInit.coordLayer.bringToFront?.()
}
})
watch(
() => fullscreen.isFullscreen.value,
() => {
nextTick(() => {
requestAnimationFrame(() => {
if (leafletMap) leafletMap.invalidateSize()
})
})
}
)
watch(mapLogic.state.hideMarkers, (v) => {
layersManager?.refreshMarkersVisibility(v)
})
@@ -496,9 +504,6 @@ onMounted(async () => {
leafletMap.on('moveend', () => mapLogic.updateDisplayCoords(leafletMap))
mapLogic.updateDisplayCoords(leafletMap)
leafletMap.on('zoomend', () => {
if (leafletMap) leafletMap.invalidateSize()
})
leafletMap.on('drag', () => {
mapLogic.state.trackingCharacterId.value = -1
})