From 1d9724d8213697627503172445c735b711419238 Mon Sep 17 00:00:00 2001 From: Greg Walker Date: Mon, 22 Jul 2024 16:31:18 -0500 Subject: [PATCH] update how settings are passed --- .../new_weather_theme/assets/js/radar.js | 48 ++++--------------- .../new_weather_theme.libraries.yml | 2 +- 2 files changed, 9 insertions(+), 41 deletions(-) diff --git a/web/themes/new_weather_theme/assets/js/radar.js b/web/themes/new_weather_theme/assets/js/radar.js index 222fe84e9..365c1f696 100644 --- a/web/themes/new_weather_theme/assets/js/radar.js +++ b/web/themes/new_weather_theme/assets/js/radar.js @@ -54,51 +54,20 @@ const setupRadar = () => { const point = [lon, lat]; - // no alerts; - // different heights on different breakpoints - // explore customizing the controls - // for a11y, describe that it's a radar map and otherwise hide it + const bookmark = { + agenda: { id: "weather", zoom: 8, center: point, location: point }, + opacity: { + alerts: 0, + }, + }; const options = { settings: { - menu: { - open: true, - }, - map: { - base: "standard", - overlays: { - artcc: false, - county: false, - cwa: false, - rfc: false, - state: false, - }, - animating: false, - zoom: 8, - center: point, - location: point, - }, - agenda: null, - layers: { - alerts: { - filter: "hazards", - opacity: 0, - }, - local: { - opacity: 0.6, - }, - stations: { - opacity: 0.8, - }, - national: { - opacity: 0.6, - }, - }, - bookmark: null, + bookmark: `v1_${btoa(JSON.stringify(bookmark))}`, quickset: null, }, urls: { - alerts: "https://alerts-v2.weather.gov", + alerts: "https://alerts.weather.gov", api: "https://api.weather.gov", forecast: "https://forecast.weather.gov", gis: "https://opengeo.ncep.noaa.gov/geoserver", @@ -106,7 +75,6 @@ const setupRadar = () => { }; window.app = window.cmiRadar.createApp("#wx_radar_container", options); - window.app.$store.dispatch("markLocation", point); [".cmi-radar-container .menu", ".cmi-radar-menu-agendas"].forEach( (selector) => { diff --git a/web/themes/new_weather_theme/new_weather_theme.libraries.yml b/web/themes/new_weather_theme/new_weather_theme.libraries.yml index e1b3f5cb7..6f0ba980c 100644 --- a/web/themes/new_weather_theme/new_weather_theme.libraries.yml +++ b/web/themes/new_weather_theme/new_weather_theme.libraries.yml @@ -51,7 +51,7 @@ hourly-toggle: assets/js/components/HourlyToggle.js: { preprocess: false } radar: - version: 2024-04-22.2 + version: 2024-06-23 css: theme: assets/css/radar/cmi-radar.6602f65c.css: