diff --git a/src/hooks/useStormEvents.js b/src/hooks/useStormEvents.js
index 4343750..e152257 100644
--- a/src/hooks/useStormEvents.js
+++ b/src/hooks/useStormEvents.js
@@ -70,14 +70,14 @@ function featureToEvent(feature, idx) {
const polygon = rawCoords.map(([lon, lat]) => [lat, lon]); // → Leaflet [lat,lon]
+ const hailIn = p.hailtag ? parseFloat(p.hailtag) : null;
+
const type = ph === 'TO' ? 'tornado'
: ph === 'FF' ? 'flood'
: ph === 'WS' || ph === 'BZ' ? 'snow'
: ph === 'WW' || ph === 'IS' ? 'ice'
: hailIn !== null ? 'hail'
: 'wind';
-
- const hailIn = p.hailtag ? parseFloat(p.hailtag) : null;
const severity = ph === 'TO' ? 'severe'
: hailIn !== null
? (hailIn >= 2.0 ? 'severe' : hailIn >= 1.5 ? 'significant' : hailIn >= 1.0 ? 'moderate' : 'trace')
@@ -101,7 +101,7 @@ function featureToEvent(feature, idx) {
async function fetchIEMEvents() {
const now = new Date();
- const cutoff = new Date(now.getTime() - 6 * 30.44 * 86400000);
+ const cutoff = new Date(now.getTime() - 36 * 30.44 * 86400000);
const url = `${IEM_SBW}?sts=${encodeURIComponent(cutoff.toISOString())}&ets=${encodeURIComponent(now.toISOString())}&wfo=${WFO}`;
const res = await fetch(url);
diff --git a/src/pages/StormIntelPage.jsx b/src/pages/StormIntelPage.jsx
index 683bc1d..33d886b 100644
--- a/src/pages/StormIntelPage.jsx
+++ b/src/pages/StormIntelPage.jsx
@@ -991,9 +991,15 @@ const StormIntelPage = () => {
// Pin drop — up to 5 pins
const [pinDropMode, setPinDropMode] = useState(false);
const [pins, setPins] = useState([]); // array of [lat,lng]
- const [pinRadius, setPinRadius] = useState(5); // miles
+ const [pinRadius, setPinRadius] = useState(5); // applied radius (miles)
+ const [radiusInput, setRadiusInput] = useState('5'); // draft value in input
const MAX_PINS = 5;
+ const applyRadius = useCallback(() => {
+ const v = parseInt(radiusInput, 10);
+ if (!isNaN(v) && v >= 1) setPinRadius(Math.min(v, 500));
+ }, [radiusInput]);
+
// Zone drawing state
const [isDrawing, setIsDrawing] = useState(false);
const [draftPolygon, setDraftPolygon] = useState([]);
@@ -1448,15 +1454,22 @@ const StormIntelPage = () => {
{
- const v = parseInt(e.target.value, 10);
- if (!isNaN(v) && v >= 1) setPinRadius(Math.min(v, 100));
- }}
+ max="500"
+ value={radiusInput}
+ onChange={e => setRadiusInput(e.target.value)}
+ onKeyDown={e => e.key === 'Enter' && applyRadius()}
className="w-14 text-center text-[11px] font-bold rounded-md border border-violet-200 dark:border-violet-500/30 bg-white dark:bg-violet-500/10 text-violet-700 dark:text-violet-300 outline-none focus:ring-1 focus:ring-violet-400 px-1 py-0.5"
/>
mi
+
+ {radiusInput !== String(pinRadius) && (
+ press Go
+ )}
)}