refactor part 1

This commit is contained in:
2026-06-23 22:17:01 -04:00
parent 214cf50908
commit d5bb7ff24f
18 changed files with 508 additions and 398 deletions

View File

@@ -177,8 +177,8 @@ function buildStationLayer(lat: number, lon: number, dark: boolean): VectorLayer
onMounted(async () => {
await fetchRadarFrames()
const lat = (current.value.gps_lat as number) || 0
const lon = (current.value.gps_lon as number) || 0
const lat = (current.value.latitude as number) || 0
const lon = (current.value.longitude as number) || 0
stationLayer = buildStationLayer(lat, lon, props.dark)
@@ -221,16 +221,16 @@ onUnmounted(() => {
watch(() => props.dark, dark => {
map.getLayers().setAt(0, buildBaseLayer(dark))
map.removeLayer(stationLayer)
const lat = (current.value.gps_lat as number) || 0
const lon = (current.value.gps_lon as number) || 0
const lat = (current.value.latitude as number) || 0
const lon = (current.value.longitude as number) || 0
stationLayer = buildStationLayer(lat, lon, dark)
map.addLayer(stationLayer)
})
let positioned = false
watch(() => current.value, () => {
const lat = (current.value.gps_lat as number) || 0
const lon = (current.value.gps_lon as number) || 0
const lat = (current.value.latitude as number) || 0
const lon = (current.value.longitude as number) || 0
if (!positioned) {
positioned = true
map.getView().animate({ center: fromLonLat([lon, lat]), duration: 500 })