From de9980b0143ed64365ef715f8807789431865168 Mon Sep 17 00:00:00 2001
From: Lance Edgar
Date: Sat, 8 Jun 2024 19:02:41 -0500
Subject: [PATCH] Show both "latest" and "loop" radar images
---
src/stores/weather.js | 8 ++++++++
src/views/WeatherView.vue | 17 ++++++++---------
2 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/src/stores/weather.js b/src/stores/weather.js
index b157459..c8c91ab 100644
--- a/src/stores/weather.js
+++ b/src/stores/weather.js
@@ -11,6 +11,8 @@ const getDefaults = () => {
cityState,
weather: null,
forecast: null,
+ radarLatestURL: null,
+ radarLoopURL: null,
}
}
@@ -28,6 +30,8 @@ export const useWeatherStore = defineStore('weather', {
this.setCityState(null)
this.setWeather(null)
this.setForecast(null)
+ this.radarLatestURL = null
+ this.radarLoopURL = null
},
async getWeather() {
@@ -48,6 +52,10 @@ export const useWeatherStore = defineStore('weather', {
this.setCityState(cityState)
}
+ const station = weather.properties.radarStation
+ this.radarLatestURL = `https://radar.weather.gov/ridge/standard/${station}_0.gif`
+ this.radarLoopURL = `https://radar.weather.gov/ridge/standard/${station}_loop.gif`
+
this.setWeather(weather)
}
diff --git a/src/views/WeatherView.vue b/src/views/WeatherView.vue
index 64ce820..3c1a66c 100644
--- a/src/views/WeatherView.vue
+++ b/src/views/WeatherView.vue
@@ -25,14 +25,6 @@ export default {
generated = generated.toLocaleTimeString('en-US', {timeStyle: 'short'})
return `Forecast @ ${generated}`
},
-
- radarURL() {
- if (this.weatherStore.weather) {
- const station = this.weatherStore.weather.properties.radarStation
- return `https://radar.weather.gov/ridge/standard/${station}_loop.gif`
- }
- },
-
},
activated() {
@@ -128,7 +120,14 @@ export default {
Radar