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 () => {
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: [],
})