minor: new nav system (#5)
All checks were successful
ci/woodpecker/push/push Pipeline was successful

Co-authored-by: Madison Grubb <madison@elastiflow.com>
Reviewed-on: #5
This commit was merged in pull request #5.
This commit is contained in:
2026-02-15 04:04:54 +00:00
parent 9261ba92bf
commit 0aab29ea72
27 changed files with 1198 additions and 688 deletions

View File

@@ -201,6 +201,7 @@ function createMap(initialCenter) {
updateMarkers()
updatePoiMarkers()
updateLiveMarkers()
nextTick(() => map.invalidateSize())
}
function updateMarkers() {
@@ -403,6 +404,8 @@ function initMapWithLocation() {
)
}
let resizeObserver = null
onMounted(async () => {
if (!import.meta.client || typeof document === 'undefined') return
const [leaflet, offline] = await Promise.all([
@@ -422,6 +425,15 @@ onMounted(async () => {
leafletRef.value = { L, offlineApi: offline }
initMapWithLocation()
document.addEventListener('click', onDocumentClick)
nextTick(() => {
if (mapRef.value) {
resizeObserver = new ResizeObserver(() => {
mapContext.value?.map?.invalidateSize()
})
resizeObserver.observe(mapRef.value)
}
})
})
function onDocumentClick(e) {
@@ -430,6 +442,10 @@ function onDocumentClick(e) {
onBeforeUnmount(() => {
document.removeEventListener('click', onDocumentClick)
if (resizeObserver && mapRef.value) {
resizeObserver.disconnect()
resizeObserver = null
}
destroyMap()
})