Popup fixes

This commit is contained in:
2026-07-06 12:31:27 -04:00
parent 1494b43ed5
commit f5cfd492f3
3 changed files with 8 additions and 6 deletions

View File

@@ -180,16 +180,18 @@ function buildStationLayer(lat: number, lon: number, dark: boolean): VectorLayer
onMounted(async () => { onMounted(async () => {
const position = await api.position() const position = await api.position()
const lat = position?.latitude || 0 current.value = {
const lon = position?.longitude || 0 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({ map = new Map({
target: mapEl.value!, target: mapEl.value!,
layers: [buildBaseLayer(props.dark), stationLayer], layers: [buildBaseLayer(props.dark), stationLayer],
interactions: defaultInteractions({ altShiftDragRotate: false, pinchRotate: false }), 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: [], controls: [],
}) })

View File

@@ -177,7 +177,7 @@ export class AirTrafficLayer {
const app = createApp(AircraftPopup, { const app = createApp(AircraftPopup, {
plane: planeRef.value, 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), onClose: () => this._closePopup(icao),
onBringToFront: () => bringToFront(container), onBringToFront: () => bringToFront(container),
}) })

View File

@@ -133,7 +133,7 @@ export class AISLayer {
const app = createApp(ShipPopup, { const app = createApp(ShipPopup, {
boat: boatRef.value, 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), onClose: () => this._closePopup(mmsi),
onBringToFront: () => bringToFront(container), onBringToFront: () => bringToFront(container),
}) })