From 104fde7640f322fbcdd6664e8edbe18b43743d77 Mon Sep 17 00:00:00 2001 From: Nikolay Tatarinov Date: Wed, 25 Feb 2026 00:36:16 +0300 Subject: [PATCH] Refactor MapView component for improved map interactions - Removed unnecessary redraw calls after initial batch updates to optimize performance. - Updated map view settings to disable animation when changing the view, enhancing user experience during map transitions. --- frontend-nuxt/components/MapView.vue | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/frontend-nuxt/components/MapView.vue b/frontend-nuxt/components/MapView.vue index 7c2777f..048e5c3 100644 --- a/frontend-nuxt/components/MapView.vue +++ b/frontend-nuxt/components/MapView.vue @@ -436,11 +436,6 @@ onMounted(async () => { if (layer!.map === u.M) layer!.refresh(u.X, u.Y, u.Z) if (overlayLayer && overlayLayer.map === u.M) overlayLayer.refresh(u.X, u.Y, u.Z) } - // After initial batch (or any batch), redraw so tiles re-request with filled cache - if (updates.length > 0 && layer) { - layer.redraw() - if (overlayLayer) overlayLayer.redraw() - } } catch { // Ignore parse errors (e.g. empty SSE message or non-JSON) } @@ -480,13 +475,13 @@ onMounted(async () => { const latLng = toLatLng(props.gridX * 100, props.gridY * 100) if (mapid !== props.mapId) changeMap(props.mapId) selectedMapId.value = props.mapId - map.setView(latLng, props.zoom) + map.setView(latLng, props.zoom, { animate: false }) } else if (mapsList.length > 0) { const first = mapsList[0] if (first) { changeMap(first.ID) selectedMapId.value = first.ID - map.setView([0, 0], HnHDefaultZoom) + map.setView([0, 0], HnHDefaultZoom, { animate: false }) } }