From f5cfd492f382c829a0345581ab799d5c9b2aebd8 Mon Sep 17 00:00:00 2001 From: ztimson Date: Mon, 6 Jul 2026 12:31:27 -0400 Subject: [PATCH] Popup fixes --- client/src/components/MapView.vue | 10 ++++++---- client/src/services/adsb.ts | 2 +- client/src/services/ais.ts | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/client/src/components/MapView.vue b/client/src/components/MapView.vue index 458cbdb..16b1992 100644 --- a/client/src/components/MapView.vue +++ b/client/src/components/MapView.vue @@ -180,16 +180,18 @@ function buildStationLayer(lat: number, lon: number, dark: boolean): VectorLayer onMounted(async () => { const position = await api.position() - const lat = position?.latitude || 0 - const lon = position?.longitude || 0 + current.value = { + latitude: position?.latitude || 0, + longitude: position?.longitude || 0, + } - stationLayer = buildStationLayer(lat, lon, props.dark) + stationLayer = buildStationLayer(current.value.latitude, current.value.longitude, props.dark) map = new Map({ target: mapEl.value!, layers: [buildBaseLayer(props.dark), stationLayer], interactions: defaultInteractions({ altShiftDragRotate: false, pinchRotate: false }), - view: new View({ center: fromLonLat([lon, lat]), zoom: 8, maxZoom: 13 }), + view: new View({ center: fromLonLat([current.value.longitude, current.value.latitude]), zoom: 8, maxZoom: 13 }), controls: [], }) diff --git a/client/src/services/adsb.ts b/client/src/services/adsb.ts index 2700e9f..8849625 100644 --- a/client/src/services/adsb.ts +++ b/client/src/services/adsb.ts @@ -177,7 +177,7 @@ export class AirTrafficLayer { const app = createApp(AircraftPopup, { plane: planeRef.value, - position: mobile ? {x: window.innerWidth / 2 - 180, y: window.innerHeight - 380 - 16} : {x: window.innerWidth - 360 - 16, y: 16}, + position: mobile ? {x: window.innerWidth / 2 - 180, y: window.innerHeight - 540 - 16} : {x: window.innerWidth - 360 - 16, y: 16}, onClose: () => this._closePopup(icao), onBringToFront: () => bringToFront(container), }) diff --git a/client/src/services/ais.ts b/client/src/services/ais.ts index fb6eadc..db718e3 100644 --- a/client/src/services/ais.ts +++ b/client/src/services/ais.ts @@ -133,7 +133,7 @@ export class AISLayer { const app = createApp(ShipPopup, { boat: boatRef.value, - position: mobile ? {x: window.innerWidth / 2 - 180, y: window.innerHeight - 380 - 16} : {x: window.innerWidth - 360 - 16, y: 16}, + position: mobile ? {x: window.innerWidth / 2 - 180, y: window.innerHeight - 540 - 16} : {x: window.innerWidth - 360 - 16, y: 16}, onClose: () => this._closePopup(mmsi), onBringToFront: () => bringToFront(container), })