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.
This commit is contained in:
@@ -436,11 +436,6 @@ onMounted(async () => {
|
|||||||
if (layer!.map === u.M) layer!.refresh(u.X, u.Y, u.Z)
|
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)
|
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 {
|
} catch {
|
||||||
// Ignore parse errors (e.g. empty SSE message or non-JSON)
|
// 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)
|
const latLng = toLatLng(props.gridX * 100, props.gridY * 100)
|
||||||
if (mapid !== props.mapId) changeMap(props.mapId)
|
if (mapid !== props.mapId) changeMap(props.mapId)
|
||||||
selectedMapId.value = props.mapId
|
selectedMapId.value = props.mapId
|
||||||
map.setView(latLng, props.zoom)
|
map.setView(latLng, props.zoom, { animate: false })
|
||||||
} else if (mapsList.length > 0) {
|
} else if (mapsList.length > 0) {
|
||||||
const first = mapsList[0]
|
const first = mapsList[0]
|
||||||
if (first) {
|
if (first) {
|
||||||
changeMap(first.ID)
|
changeMap(first.ID)
|
||||||
selectedMapId.value = first.ID
|
selectedMapId.value = first.ID
|
||||||
map.setView([0, 0], HnHDefaultZoom)
|
map.setView([0, 0], HnHDefaultZoom, { animate: false })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user