Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

WV-3018: Frontend-rendering of Snapshots (#5758)

Patrick Moulden2bca2d35b14a
diff --git a/config/default/common/config/wv.json/layers/activate/ACTIVATE_HU-25_Falcon_Ozone.json b/config/default/common/config/wv.json/layers/activate/ACTIVATE_HU-25_Falcon_Ozone.json
index 6bd45cae1..0c8e0f1b4 100644
--- a/config/default/common/config/wv.json/layers/activate/ACTIVATE_HU-25_Falcon_Ozone.json
+++ b/config/default/common/config/wv.json/layers/activate/ACTIVATE_HU-25_Falcon_Ozone.json
@@ -11,7 +11,7 @@
"ongoing": false,
"dataAvailability": "dd",
"disableCharting": true,
- "disableSnapshot": true,
+ "disableGIF": true,
"disableCustomPalettes": true,
"layergroup": "Ozone",
"vectorStyle": {
diff --git a/config/default/common/config/wv.json/layers/activate/ACTIVATE_King_Air_Flight_Track.json b/config/default/common/config/wv.json/layers/activate/ACTIVATE_King_Air_Flight_Track.json
index 16037b129..7aa5a9df6 100644
--- a/config/default/common/config/wv.json/layers/activate/ACTIVATE_King_Air_Flight_Track.json
+++ b/config/default/common/config/wv.json/layers/activate/ACTIVATE_King_Air_Flight_Track.json
@@ -11,7 +11,7 @@
"ongoing": false,
"dataAvailability": "dd",
"disableCharting": true,
- "disableSnapshot": true,
+ "disableGIF": true,
"disableCustomPalettes": true,
"layergroup": "Suborbital Flight Tracks",
"vectorStyle": {
diff --git a/config/default/common/config/wv.json/layers/aeronet/AERONET_ANGSTROM_440-870NM.json b/config/default/common/config/wv.json/layers/aeronet/AERONET_ANGSTROM_440-870NM.json
index 3108dde3c..b0966ee27 100644
--- a/config/default/common/config/wv.json/layers/aeronet/AERONET_ANGSTROM_440-870NM.json
+++ b/config/default/common/config/wv.json/layers/aeronet/AERONET_ANGSTROM_440-870NM.json
@@ -10,7 +10,7 @@
"tags": "vectors aeronet angstrom",
"type": "vector",
"layergroup": "Aerosol Optical Depth",
- "disableSnapshot": true,
+ "disableGIF": true,
"vectorStyle": {
"id": "AERONET_ANGSTROM_440-870NM"
},
diff --git a/config/default/common/config/wv.json/layers/aeronet/AERONET_AOD_500NM.json b/config/default/common/config/wv.json/layers/aeronet/AERONET_AOD_500NM.json
index 44a4ac65b..47a3dbaf0 100644
--- a/config/default/common/config/wv.json/layers/aeronet/AERONET_AOD_500NM.json
+++ b/config/default/common/config/wv.json/layers/aeronet/AERONET_AOD_500NM.json
@@ -10,7 +10,7 @@
"tags": "vectors aeronet aod",
"type": "vector",
"layergroup": "Aerosol Optical Depth",
- "disableSnapshot": true,
+ "disableGIF": true,
"vectorStyle": {
"id": "AERONET_AOD_500NM"
},
diff --git a/config/default/common/config/wv.json/layers/aeronet/DAILY_AERONET_ANGSTROM_440-870NM.json b/config/default/common/config/wv.json/layers/aeronet/DAILY_AERONET_ANGSTROM_440-870NM.json
index 090a5f0f6..0fd645ee9 100644
--- a/config/default/common/config/wv.json/layers/aeronet/DAILY_AERONET_ANGSTROM_440-870NM.json
+++ b/config/default/common/config/wv.json/layers/aeronet/DAILY_AERONET_ANGSTROM_440-870NM.json
@@ -10,7 +10,7 @@
"tags": "vectors aeronet angstrom",
"type": "vector",
"layergroup": "Aerosol Optical Depth",
- "disableSnapshot": true,
+ "disableGIF": true,
"vectorStyle": {
"id": "DAILY_AERONET_ANGSTROM_440-870NM"
},
diff --git a/config/default/common/config/wv.json/layers/aeronet/DAILY_AERONET_AOD_500NM.json b/config/default/common/config/wv.json/layers/aeronet/DAILY_AERONET_AOD_500NM.json
index 4c055d205..a19d074b9 100644
--- a/config/default/common/config/wv.json/layers/aeronet/DAILY_AERONET_AOD_500NM.json
+++ b/config/default/common/config/wv.json/layers/aeronet/DAILY_AERONET_AOD_500NM.json
@@ -10,7 +10,7 @@
"tags": "vectors aeronet aod",
"type": "vector",
"layergroup": "Aerosol Optical Depth",
- "disableSnapshot": true,
+ "disableGIF": true,
"vectorStyle": {
"id": "DAILY_AERONET_AOD_500NM"
},
diff --git a/config/default/common/config/wv.json/layers/ajax/AJAX_Alpha_Jet_Ozone.json b/config/default/common/config/wv.json/layers/ajax/AJAX_Alpha_Jet_Ozone.json
index 057d3d5ee..d06df903d 100644
--- a/config/default/common/config/wv.json/layers/ajax/AJAX_Alpha_Jet_Ozone.json
+++ b/config/default/common/config/wv.json/layers/ajax/AJAX_Alpha_Jet_Ozone.json
@@ -11,7 +11,7 @@
"ongoing": false,
"dataAvailability": "dd",
"disableCharting": true,
- "disableSnapshot": true,
+ "disableGIF": true,
"disableCustomPalettes": true,
"layergroup": "Ozone",
"vectorStyle": {
diff --git a/config/default/common/config/wv.json/layers/arcsix/ARCSIX_G-III_Flight_Track.json b/config/default/common/config/wv.json/layers/arcsix/ARCSIX_G-III_Flight_Track.json
index 8a81f2581..3be4aa31b 100644
--- a/config/default/common/config/wv.json/layers/arcsix/ARCSIX_G-III_Flight_Track.json
+++ b/config/default/common/config/wv.json/layers/arcsix/ARCSIX_G-III_Flight_Track.json
@@ -11,7 +11,7 @@
"ongoing": false,
"dataAvailability": "dd",
"disableCharting": true,
- "disableSnapshot": true,
+ "disableGIF": true,
"disableCustomPalettes": true,
"layergroup": "Suborbital Flight Tracks",
"vectorStyle": {
diff --git a/config/default/common/config/wv.json/layers/arcsix/ARCSIX_P-3B_Flight_Track.json b/config/default/common/config/wv.json/layers/arcsix/ARCSIX_P-3B_Flight_Track.json
index e21578e58..abd158003 100644
--- a/config/default/common/config/wv.json/layers/arcsix/ARCSIX_P-3B_Flight_Track.json
+++ b/config/default/common/config/wv.json/layers/arcsix/ARCSIX_P-3B_Flight_Track.json
@@ -11,7 +11,7 @@
"ongoing": false,
"dataAvailability": "dd",
"disableCharting": true,
- "disableSnapshot": true,
+ "disableGIF": true,
"disableCustomPalettes": true,
"layergroup": "Suborbital Flight Tracks",
"vectorStyle": {
diff --git a/config/default/common/config/wv.json/layers/arcsix/ARCSIX_SPEC-Learjet_Flight_Track.json b/config/default/common/config/wv.json/layers/arcsix/ARCSIX_SPEC-Learjet_Flight_Track.json
index 10d77b8bf..70261d93d 100644
--- a/config/default/common/config/wv.json/layers/arcsix/ARCSIX_SPEC-Learjet_Flight_Track.json
+++ b/config/default/common/config/wv.json/layers/arcsix/ARCSIX_SPEC-Learjet_Flight_Track.json
@@ -11,7 +11,7 @@
"ongoing": false,
"dataAvailability": "dd",
"disableCharting": true,
- "disableSnapshot": true,
+ "disableGIF": true,
"disableCustomPalettes": true,
"layergroup": "Suborbital Flight Tracks",
"vectorStyle": {
diff --git a/config/default/common/config/wv.json/layers/asia-aq/ASIA-AQ_DC-8_NO2.json b/config/default/common/config/wv.json/layers/asia-aq/ASIA-AQ_DC-8_NO2.json
index 28a8958b5..1c56d0a31 100644
--- a/config/default/common/config/wv.json/layers/asia-aq/ASIA-AQ_DC-8_NO2.json
+++ b/config/default/common/config/wv.json/layers/asia-aq/ASIA-AQ_DC-8_NO2.json
@@ -11,7 +11,7 @@
"ongoing": false,
"dataAvailability": "dd",
"disableCharting": true,
- "disableSnapshot": true,
+ "disableGIF": true,
"disableCustomPalettes": true,
"layergroup": "Nitrogen Dioxide",
"vectorStyle": {
diff --git a/config/default/common/config/wv.json/layers/asia-aq/ASIA-AQ_G-III_Flight_Track.json b/config/default/common/config/wv.json/layers/asia-aq/ASIA-AQ_G-III_Flight_Track.json
index cc6e721e4..78319d937 100644
--- a/config/default/common/config/wv.json/layers/asia-aq/ASIA-AQ_G-III_Flight_Track.json
+++ b/config/default/common/config/wv.json/layers/asia-aq/ASIA-AQ_G-III_Flight_Track.json
@@ -11,7 +11,7 @@
"ongoing": false,
"dataAvailability": "dd",
"disableCharting": true,
- "disableSnapshot": true,
+ "disableGIF": true,
"disableCustomPalettes": true,
"layergroup": "Suborbital Flight Tracks",
"vectorStyle": {
diff --git a/config/default/common/config/wv.json/layers/dcotss/DCOTSS_ER-2_ROZE_Ozone.json b/config/default/common/config/wv.json/layers/dcotss/DCOTSS_ER-2_ROZE_Ozone.json
index c0d4876e6..83f4ae859 100644
--- a/config/default/common/config/wv.json/layers/dcotss/DCOTSS_ER-2_ROZE_Ozone.json
+++ b/config/default/common/config/wv.json/layers/dcotss/DCOTSS_ER-2_ROZE_Ozone.json
@@ -11,7 +11,7 @@
"ongoing": false,
"dataAvailability": "dd",
"disableCharting": true,
- "disableSnapshot": true,
+ "disableGIF": true,
"disableCustomPalettes": true,
"layergroup": "Ozone",
"vectorStyle": {
diff --git a/config/default/common/config/wv.json/layers/dcotss/DCOTSS_ER-2_UCATS_Ozone.json b/config/default/common/config/wv.json/layers/dcotss/DCOTSS_ER-2_UCATS_Ozone.json
index d37bda0bf..b8caf7a5d 100644
--- a/config/default/common/config/wv.json/layers/dcotss/DCOTSS_ER-2_UCATS_Ozone.json
+++ b/config/default/common/config/wv.json/layers/dcotss/DCOTSS_ER-2_UCATS_Ozone.json
@@ -11,7 +11,7 @@
"ongoing": false,
"dataAvailability": "dd",
"disableCharting": true,
- "disableSnapshot": true,
+ "disableGIF": true,
"disableCustomPalettes": true,
"layergroup": "Ozone",
"vectorStyle": {
diff --git a/config/default/common/config/wv.json/layers/eumetsat/EUMETSAT_RING_Airmass_RGB.json b/config/default/common/config/wv.json/layers/eumetsat/EUMETSAT_RING_Airmass_RGB.json
index d5c82e48a..b2aea5f0b 100644
--- a/config/default/common/config/wv.json/layers/eumetsat/EUMETSAT_RING_Airmass_RGB.json
+++ b/config/default/common/config/wv.json/layers/eumetsat/EUMETSAT_RING_Airmass_RGB.json
@@ -10,7 +10,7 @@
"type": "wms",
"format": "image/png",
"wrapX": true,
- "disableSnapshot": true,
+ "disableGIF": true,
"period": "subdaily",
"layergroup": "Geostationary",
"startDate": "2021-02-06T00:00:00Z",
diff --git a/config/default/common/config/wv.json/layers/eumetsat/EUMETSAT_RING_Ash_RGB.json b/config/default/common/config/wv.json/layers/eumetsat/EUMETSAT_RING_Ash_RGB.json
index 3969f762b..449ff9966 100644
--- a/config/default/common/config/wv.json/layers/eumetsat/EUMETSAT_RING_Ash_RGB.json
+++ b/config/default/common/config/wv.json/layers/eumetsat/EUMETSAT_RING_Ash_RGB.json
@@ -10,7 +10,7 @@
"type": "wms",
"format": "image/png",
"wrapX": true,
- "disableSnapshot": true,
+ "disableGIF": true,
"period": "subdaily",
"layergroup": "Geostationary",
"startDate": "2021-02-06T00:00:00Z",
diff --git a/config/default/common/config/wv.json/layers/eumetsat/EUMETSAT_RING_Dust_RGB.json b/config/default/common/config/wv.json/layers/eumetsat/EUMETSAT_RING_Dust_RGB.json
index ad0df1900..b167a9016 100644
--- a/config/default/common/config/wv.json/layers/eumetsat/EUMETSAT_RING_Dust_RGB.json
+++ b/config/default/common/config/wv.json/layers/eumetsat/EUMETSAT_RING_Dust_RGB.json
@@ -10,7 +10,7 @@
"type": "wms",
"format": "image/png",
"wrapX": true,
- "disableSnapshot": true,
+ "disableGIF": true,
"period": "subdaily",
"layergroup": "Geostationary",
"startDate": "2021-02-06T00:00:00Z",
diff --git a/config/default/common/config/wv.json/layers/eumetsat/EUMETSAT_RING_IR108.json b/config/default/common/config/wv.json/layers/eumetsat/EUMETSAT_RING_IR108.json
index 9402dfed7..b52222644 100644
--- a/config/default/common/config/wv.json/layers/eumetsat/EUMETSAT_RING_IR108.json
+++ b/config/default/common/config/wv.json/layers/eumetsat/EUMETSAT_RING_IR108.json
@@ -10,7 +10,7 @@
"type": "wms",
"format": "image/png",
"wrapX": true,
- "disableSnapshot": true,
+ "disableGIF": true,
"period": "subdaily",
"layergroup": "Geostationary",
"startDate": "2021-02-06T00:00:00Z",
diff --git a/config/default/common/config/wv.json/layers/eumetsat/EUMETSAT_RING_Natural_Color_RGB.json b/config/default/common/config/wv.json/layers/eumetsat/EUMETSAT_RING_Natural_Color_RGB.json
index e95077873..19e02ac48 100644
--- a/config/default/common/config/wv.json/layers/eumetsat/EUMETSAT_RING_Natural_Color_RGB.json
+++ b/config/default/common/config/wv.json/layers/eumetsat/EUMETSAT_RING_Natural_Color_RGB.json
@@ -10,7 +10,7 @@
"type": "wms",
"format": "image/png",
"wrapX": true,
- "disableSnapshot": true,
+ "disableGIF": true,
"period": "subdaily",
"layergroup": "Geostationary",
"startDate": "2021-02-06T00:00:00Z",
diff --git a/config/default/common/config/wv.json/layers/korus-aq/KORUS-AQ_B-200_Flight_Track.json b/config/default/common/config/wv.json/layers/korus-aq/KORUS-AQ_B-200_Flight_Track.json
index 440826d0b..5495978e3 100644
--- a/config/default/common/config/wv.json/layers/korus-aq/KORUS-AQ_B-200_Flight_Track.json
+++ b/config/default/common/config/wv.json/layers/korus-aq/KORUS-AQ_B-200_Flight_Track.json
@@ -11,7 +11,7 @@
"ongoing": false,
"dataAvailability": "dd",
"disableCharting": true,
- "disableSnapshot": true,
+ "disableGIF": true,
"disableCustomPalettes": true,
"layergroup": "Ozone",
"vectorStyle": {
diff --git a/config/default/common/config/wv.json/layers/korus-aq/KORUS-AQ_DC-8_Ozone.json b/config/default/common/config/wv.json/layers/korus-aq/KORUS-AQ_DC-8_Ozone.json
index a40acb1f9..785528aa3 100644
--- a/config/default/common/config/wv.json/layers/korus-aq/KORUS-AQ_DC-8_Ozone.json
+++ b/config/default/common/config/wv.json/layers/korus-aq/KORUS-AQ_DC-8_Ozone.json
@@ -11,7 +11,7 @@
"ongoing": false,
"dataAvailability": "dd",
"disableCharting": true,
- "disableSnapshot": true,
+ "disableGIF": true,
"disableCustomPalettes": true,
"layergroup": "Ozone",
"vectorStyle": {
diff --git a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_Customizable_Landsat.json b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_Customizable_Landsat.json
index 31b73c4c5..4a88bd4ea 100644
--- a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_Customizable_Landsat.json
+++ b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_Customizable_Landsat.json
@@ -22,7 +22,7 @@
"color_formula": "Gamma RGB 2.5 Saturation 1.2 Sigmoidal RGB 10 0.35",
"bands_regex": "B[0-9][0-9]"
},
- "disableSnapshot": true,
+ "disableGIF": true,
"wrapX": false,
"minZoom": 7,
"projections": {
diff --git a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_Customizable_Sentinel.json b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_Customizable_Sentinel.json
index 9a86baa63..748098614 100644
--- a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_Customizable_Sentinel.json
+++ b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_Customizable_Sentinel.json
@@ -23,7 +23,7 @@
"bands_regex": "B[0-9][0-9A-Za-z]"
},
"wrapX": false,
- "disableSnapshot": true,
+ "disableGIF": true,
"minZoom": 7,
"projections": {
"geographic": {
diff --git a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_EVI_Landsat.json b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_EVI_Landsat.json
index dbf143e76..4a16752a2 100644
--- a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_EVI_Landsat.json
+++ b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_EVI_Landsat.json
@@ -22,7 +22,7 @@
"colormap_name": "brbg",
"bands_regex": "B[0-9][0-9]"
},
- "disableSnapshot": true,
+ "disableGIF": true,
"minZoom": 7,
"wrapX": false,
"projections": {
diff --git a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_EVI_Sentinel.json b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_EVI_Sentinel.json
index ff7276257..2ae269649 100644
--- a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_EVI_Sentinel.json
+++ b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_EVI_Sentinel.json
@@ -22,7 +22,7 @@
"colormap_name": "brbg",
"bands_regex": "B[0-9][0-9A-Za-z]"
},
- "disableSnapshot": true,
+ "disableGIF": true,
"minZoom": 7,
"wrapX": false,
"projections": {
diff --git a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_False_Color_Landsat.json b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_False_Color_Landsat.json
index 8a5cb259f..08c641587 100644
--- a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_False_Color_Landsat.json
+++ b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_False_Color_Landsat.json
@@ -23,7 +23,7 @@
"bands_regex": "B[0-9][0-9]"
},
"wrapX": false,
- "disableSnapshot": true,
+ "disableGIF": true,
"minZoom": 7,
"projections": {
"geographic": {
diff --git a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_False_Color_Sentinel.json b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_False_Color_Sentinel.json
index 292dd0f90..86afe4764 100644
--- a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_False_Color_Sentinel.json
+++ b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_False_Color_Sentinel.json
@@ -23,7 +23,7 @@
"bands_regex": "B[0-9][0-9A-Za-z]"
},
"wrapX": false,
- "disableSnapshot": true,
+ "disableGIF": true,
"minZoom": 7,
"projections": {
"geographic": {
diff --git a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_False_Color_Urban_Landsat.json b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_False_Color_Urban_Landsat.json
index 9842faf42..3d90ac90f 100644
--- a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_False_Color_Urban_Landsat.json
+++ b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_False_Color_Urban_Landsat.json
@@ -23,7 +23,7 @@
"bands_regex": "B[0-9][0-9]"
},
"wrapX": false,
- "disableSnapshot": true,
+ "disableGIF": true,
"minZoom": 7,
"projections": {
"geographic": {
diff --git a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_False_Color_Urban_Sentinel.json b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_False_Color_Urban_Sentinel.json
index 2f2d87a99..ff1d5031d 100644
--- a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_False_Color_Urban_Sentinel.json
+++ b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_False_Color_Urban_Sentinel.json
@@ -23,7 +23,7 @@
"bands_regex": "B[0-9][0-9A-Za-z]"
},
"wrapX": false,
- "disableSnapshot": true,
+ "disableGIF": true,
"minZoom": 7,
"projections": {
"geographic": {
diff --git a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_False_Color_Vegetation_Landsat.json b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_False_Color_Vegetation_Landsat.json
index bf4218468..468696846 100644
--- a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_False_Color_Vegetation_Landsat.json
+++ b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_False_Color_Vegetation_Landsat.json
@@ -23,7 +23,7 @@
"bands_regex": "B[0-9][0-9]"
},
"wrapX": false,
- "disableSnapshot": true,
+ "disableGIF": true,
"minZoom": 7,
"projections": {
"geographic": {
diff --git a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_False_Color_Vegetation_Sentinel.json b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_False_Color_Vegetation_Sentinel.json
index 6f619319b..60830cfcd 100644
--- a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_False_Color_Vegetation_Sentinel.json
+++ b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_False_Color_Vegetation_Sentinel.json
@@ -23,7 +23,7 @@
"bands_regex": "B[0-9][0-9A-Za-z]"
},
"wrapX": false,
- "disableSnapshot": true,
+ "disableGIF": true,
"minZoom": 7,
"projections": {
"geographic": {
diff --git a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_MGRS_Granule_Grid.json b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_MGRS_Granule_Grid.json
index 6a12b10fd..ef795b313 100644
--- a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_MGRS_Granule_Grid.json
+++ b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_MGRS_Granule_Grid.json
@@ -8,7 +8,7 @@
"layergroup": "Reference",
"type": "vector",
"wrapX": true,
- "disableSnapshot": true
+ "disableGIF": true
}
}
}
\ No newline at end of file
diff --git a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_MSAVI_Landsat.json b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_MSAVI_Landsat.json
index ab05b2aaa..988ef847b 100644
--- a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_MSAVI_Landsat.json
+++ b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_MSAVI_Landsat.json
@@ -22,7 +22,7 @@
"colormap_name": "brbg",
"bands_regex": "B[0-9][0-9]"
},
- "disableSnapshot": true,
+ "disableGIF": true,
"minZoom": 7,
"wrapX": false,
"projections": {
diff --git a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_MSAVI_Sentinel.json b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_MSAVI_Sentinel.json
index 06cd77de4..1ae1550b0 100644
--- a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_MSAVI_Sentinel.json
+++ b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_MSAVI_Sentinel.json
@@ -22,7 +22,7 @@
"colormap_name": "brbg",
"bands_regex": "B[0-9][0-9A-Za-z]"
},
- "disableSnapshot": true,
+ "disableGIF": true,
"minZoom": 7,
"wrapX": false,
"projections": {
diff --git a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_Moisture_Index_Landsat.json b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_Moisture_Index_Landsat.json
index e38b0564d..2523ab42b 100644
--- a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_Moisture_Index_Landsat.json
+++ b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_Moisture_Index_Landsat.json
@@ -22,7 +22,7 @@
"colormap_name": "bwr_r",
"bands_regex": "B[0-9][0-9]"
},
- "disableSnapshot": true,
+ "disableGIF": true,
"minZoom": 7,
"wrapX": false,
"projections": {
diff --git a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_Moisture_Index_Sentinel.json b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_Moisture_Index_Sentinel.json
index 7794b6366..fe43378be 100644
--- a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_Moisture_Index_Sentinel.json
+++ b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_Moisture_Index_Sentinel.json
@@ -22,7 +22,7 @@
"colormap_name": "bwr_r",
"bands_regex": "B[0-9][0-9A-Za-z]"
},
- "disableSnapshot": true,
+ "disableGIF": true,
"minZoom": 7,
"wrapX": false,
"projections": {
diff --git a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NBR2_Landsat.json b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NBR2_Landsat.json
index 933cf8ac4..ebe8cc4a4 100644
--- a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NBR2_Landsat.json
+++ b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NBR2_Landsat.json
@@ -22,7 +22,7 @@
"colormap_name": "puor",
"bands_regex": "B[0-9][0-9]"
},
- "disableSnapshot": true,
+ "disableGIF": true,
"minZoom": 7,
"wrapX": false,
"projections": {
diff --git a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NBR2_Sentinel.json b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NBR2_Sentinel.json
index d6020a3c8..559246f43 100644
--- a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NBR2_Sentinel.json
+++ b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NBR2_Sentinel.json
@@ -22,7 +22,7 @@
"colormap_name": "puor",
"bands_regex": "B[0-9][0-9A-Za-z]"
},
- "disableSnapshot": true,
+ "disableGIF": true,
"minZoom": 7,
"wrapX": false,
"projections": {
diff --git a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NBR_Landsat.json b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NBR_Landsat.json
index 6b4ae1bb0..25bc1a5d4 100644
--- a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NBR_Landsat.json
+++ b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NBR_Landsat.json
@@ -22,7 +22,7 @@
"colormap_name": "puor",
"bands_regex": "B[0-9][0-9]"
},
- "disableSnapshot": true,
+ "disableGIF": true,
"minZoom": 7,
"wrapX": false,
"projections": {
diff --git a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NBR_Sentinel.json b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NBR_Sentinel.json
index 4437d7e7c..e4cccfd71 100644
--- a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NBR_Sentinel.json
+++ b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NBR_Sentinel.json
@@ -22,7 +22,7 @@
"colormap_name": "puor",
"bands_regex": "B[0-9][0-9A-Za-z]"
},
- "disableSnapshot": true,
+ "disableGIF": true,
"minZoom": 7,
"wrapX": false,
"projections": {
diff --git a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NDSI_Landsat.json b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NDSI_Landsat.json
index 6db4643aa..f7a45baed 100644
--- a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NDSI_Landsat.json
+++ b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NDSI_Landsat.json
@@ -22,7 +22,7 @@
"colormap_name": "winter_r",
"bands_regex": "B[0-9][0-9]"
},
- "disableSnapshot": true,
+ "disableGIF": true,
"minZoom": 7,
"wrapX": false,
"projections": {
diff --git a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NDSI_Sentinel.json b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NDSI_Sentinel.json
index 99d14e9d1..6fe1ee775 100644
--- a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NDSI_Sentinel.json
+++ b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NDSI_Sentinel.json
@@ -22,7 +22,7 @@
"colormap_name": "winter_r",
"bands_regex": "B[0-9][0-9A-Za-z]"
},
- "disableSnapshot": true,
+ "disableGIF": true,
"minZoom": 7,
"wrapX": false,
"projections": {
diff --git a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NDVI_Landsat.json b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NDVI_Landsat.json
index 6c12a0720..0aeb3990f 100644
--- a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NDVI_Landsat.json
+++ b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NDVI_Landsat.json
@@ -22,7 +22,7 @@
"colormap_name": "brbg",
"bands_regex": "B[0-9][0-9]"
},
- "disableSnapshot": true,
+ "disableGIF": true,
"minZoom": 7,
"wrapX": false,
"projections": {
diff --git a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NDVI_Sentinel.json b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NDVI_Sentinel.json
index a07c93e66..1dc9c3af7 100644
--- a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NDVI_Sentinel.json
+++ b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NDVI_Sentinel.json
@@ -22,7 +22,7 @@
"colormap_name": "brbg",
"bands_regex": "B[0-9][0-9A-Za-z]"
},
- "disableSnapshot": true,
+ "disableGIF": true,
"minZoom": 7,
"wrapX": false,
"projections": {
diff --git a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NDWI_Landsat.json b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NDWI_Landsat.json
index 45b1d7fcd..9fb075a31 100644
--- a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NDWI_Landsat.json
+++ b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NDWI_Landsat.json
@@ -22,7 +22,7 @@
"colormap_name": "gnbu",
"bands_regex": "B[0-9][0-9]"
},
- "disableSnapshot": true,
+ "disableGIF": true,
"minZoom": 7,
"wrapX": false,
"projections": {
diff --git a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NDWI_Sentinel.json b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NDWI_Sentinel.json
index fb92b6315..afc3c61d8 100644
--- a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NDWI_Sentinel.json
+++ b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_NDWI_Sentinel.json
@@ -22,7 +22,7 @@
"colormap_name": "gnbu",
"bands_regex": "B[0-9][0-9A-Za-z]"
},
- "disableSnapshot": true,
+ "disableGIF": true,
"minZoom": 7,
"wrapX": false,
"projections": {
diff --git a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_SAVI_Landsat.json b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_SAVI_Landsat.json
index 6d76d9793..811e45b69 100644
--- a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_SAVI_Landsat.json
+++ b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_SAVI_Landsat.json
@@ -22,7 +22,7 @@
"colormap_name": "brbg",
"bands_regex": "B[0-9][0-9]"
},
- "disableSnapshot": true,
+ "disableGIF": true,
"minZoom": 7,
"wrapX": false,
"projections": {
diff --git a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_SAVI_Sentinel.json b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_SAVI_Sentinel.json
index df1d9c9ce..83be02260 100644
--- a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_SAVI_Sentinel.json
+++ b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_SAVI_Sentinel.json
@@ -22,7 +22,7 @@
"colormap_name": "brbg",
"bands_regex": "B[0-9][0-9A-Za-z]"
},
- "disableSnapshot": true,
+ "disableGIF": true,
"minZoom": 7,
"wrapX": false,
"projections": {
diff --git a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_Shortwave_Infrared_Landsat.json b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_Shortwave_Infrared_Landsat.json
index 04719a113..65cd14b71 100644
--- a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_Shortwave_Infrared_Landsat.json
+++ b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_Shortwave_Infrared_Landsat.json
@@ -23,7 +23,7 @@
"bands_regex": "B[0-9][0-9]"
},
"wrapX": false,
- "disableSnapshot": true,
+ "disableGIF": true,
"minZoom": 7,
"projections": {
"geographic": {
diff --git a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_Shortwave_Infrared_Sentinel.json b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_Shortwave_Infrared_Sentinel.json
index 5c4e8e6d4..df7ff529a 100644
--- a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_Shortwave_Infrared_Sentinel.json
+++ b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_Shortwave_Infrared_Sentinel.json
@@ -23,7 +23,7 @@
"bands_regex": "B[0-9][0-9A-Za-z]"
},
"wrapX": false,
- "disableSnapshot": true,
+ "disableGIF": true,
"minZoom": 7,
"projections": {
"geographic": {
diff --git a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_TVI_Landsat.json b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_TVI_Landsat.json
index c65fab35b..eb7e12bb4 100644
--- a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_TVI_Landsat.json
+++ b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_TVI_Landsat.json
@@ -22,7 +22,7 @@
"colormap_name": "brbg",
"bands_regex": "B[0-9][0-9]"
},
- "disableSnapshot": true,
+ "disableGIF": true,
"minZoom": 7,
"wrapX": false,
"projections": {
diff --git a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_TVI_Sentinel.json b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_TVI_Sentinel.json
index 5498e2dec..461f03a8a 100644
--- a/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_TVI_Sentinel.json
+++ b/config/default/common/config/wv.json/layers/multi-mission/hls/HLS_TVI_Sentinel.json
@@ -22,7 +22,7 @@
"colormap_name": "brbg",
"bands_regex": "B[0-9][0-9A-Za-z]"
},
- "disableSnapshot": true,
+ "disableGIF": true,
"minZoom": 7,
"wrapX": false,
"projections": {
diff --git a/config/default/common/config/wv.json/layers/multi-mission/merged/NOAA_2025_ERI_WMTS.json b/config/default/common/config/wv.json/layers/multi-mission/merged/NOAA_2025_ERI_WMTS.json
index d67d90060..51a147b6d 100644
--- a/config/default/common/config/wv.json/layers/multi-mission/merged/NOAA_2025_ERI_WMTS.json
+++ b/config/default/common/config/wv.json/layers/multi-mission/merged/NOAA_2025_ERI_WMTS.json
@@ -34,7 +34,7 @@
["2025-01-20", "2025-01-21"],
["2025-01-28", "2025-01-29"]
],
- "disableSnapshot": true,
+ "disableGIF": true,
"layergroup": "Corrected Reflectance",
"wrapX": true,
"projections": {
diff --git a/config/default/common/config/wv.json/layers/multi-mission/opera/OPERA_L2_Radiometric_Terrain_Corrected_SAR_Sentinel-1_12Day.json b/config/default/common/config/wv.json/layers/multi-mission/opera/OPERA_L2_Radiometric_Terrain_Corrected_SAR_Sentinel-1_12Day.json
index 4a8f07d57..7c7298c1e 100644
--- a/config/default/common/config/wv.json/layers/multi-mission/opera/OPERA_L2_Radiometric_Terrain_Corrected_SAR_Sentinel-1_12Day.json
+++ b/config/default/common/config/wv.json/layers/multi-mission/opera/OPERA_L2_Radiometric_Terrain_Corrected_SAR_Sentinel-1_12Day.json
@@ -7,7 +7,7 @@
"subtitle": "RTC-S1/Sentinel-1",
"ongoing": true,
"enableCMRDataFinder": false,
- "disableSnapshot": true,
+ "disableGIF": true,
"description": "multi-mission/opera/OPERA_L2_Radiometric_Terrain_Corrected_SAR_Sentinel-1_12Day",
"tags": "asf asfdaac rtc synthetic aperture radar backscatter opera",
"group": "overlays",
diff --git a/config/default/common/config/wv.json/layers/nisar/NISAR_L2_Geocoded_Polarimetric_Covariance_12Day.json b/config/default/common/config/wv.json/layers/nisar/NISAR_L2_Geocoded_Polarimetric_Covariance_12Day.json
index ab7e8b6dc..7b93157ad 100644
--- a/config/default/common/config/wv.json/layers/nisar/NISAR_L2_Geocoded_Polarimetric_Covariance_12Day.json
+++ b/config/default/common/config/wv.json/layers/nisar/NISAR_L2_Geocoded_Polarimetric_Covariance_12Day.json
@@ -7,7 +7,7 @@
"subtitle": "NISAR GCOV",
"ongoing": true,
"enableCMRDataFinder": false,
- "disableSnapshot": true,
+ "disableGIF": true,
"description": "nisar/NISAR_L2_Geocoded_Polarimetric_Covariance_12Day",
"tags": "asf asfdaac synthetic aperture radar backscatter nisar",
"group": "overlays",
diff --git a/config/default/common/config/wv.json/layers/pace-pax/PACE-PAX_CIRPAS-TO_Flight_Track.json b/config/default/common/config/wv.json/layers/pace-pax/PACE-PAX_CIRPAS-TO_Flight_Track.json
index 2dbac5273..377a2fec2 100644
--- a/config/default/common/config/wv.json/layers/pace-pax/PACE-PAX_CIRPAS-TO_Flight_Track.json
+++ b/config/default/common/config/wv.json/layers/pace-pax/PACE-PAX_CIRPAS-TO_Flight_Track.json
@@ -11,7 +11,7 @@
"ongoing": false,
"dataAvailability": "dd",
"disableCharting": true,
- "disableSnapshot": true,
+ "disableGIF": true,
"disableCustomPalettes": true,
"layergroup": "Suborbital Flight Tracks",
"vectorStyle": {
diff --git a/config/default/common/config/wv.json/layers/pace-pax/PACE-PAX_ER-2_Flight_Track.json b/config/default/common/config/wv.json/layers/pace-pax/PACE-PAX_ER-2_Flight_Track.json
index c524fdc88..305f9fd9b 100644
--- a/config/default/common/config/wv.json/layers/pace-pax/PACE-PAX_ER-2_Flight_Track.json
+++ b/config/default/common/config/wv.json/layers/pace-pax/PACE-PAX_ER-2_Flight_Track.json
@@ -11,7 +11,7 @@
"ongoing": false,
"dataAvailability": "dd",
"disableCharting": true,
- "disableSnapshot": true,
+ "disableGIF": true,
"disableCustomPalettes": true,
"layergroup": "Suborbital Flight Tracks",
"vectorStyle": {
diff --git a/config/default/common/config/wv.json/layers/pace-pax/PACE-PAX_RV-Shearwater_Ship_Track.json b/config/default/common/config/wv.json/layers/pace-pax/PACE-PAX_RV-Shearwater_Ship_Track.json
index e2378cba9..ada406446 100644
--- a/config/default/common/config/wv.json/layers/pace-pax/PACE-PAX_RV-Shearwater_Ship_Track.json
+++ b/config/default/common/config/wv.json/layers/pace-pax/PACE-PAX_RV-Shearwater_Ship_Track.json
@@ -11,7 +11,7 @@
"ongoing": false,
"dataAvailability": "dd",
"disableCharting": true,
- "disableSnapshot": true,
+ "disableGIF": true,
"disableCustomPalettes": true,
"layergroup": "Suborbital Ship Tracks",
"vectorStyle": {
diff --git a/config/default/common/config/wv.json/layers/reference/Reference_Labels_15m.json b/config/default/common/config/wv.json/layers/reference/Reference_Labels_15m.json
index 3b303fd50..831553ed6 100644
--- a/config/default/common/config/wv.json/layers/reference/Reference_Labels_15m.json
+++ b/config/default/common/config/wv.json/layers/reference/Reference_Labels_15m.json
@@ -10,7 +10,7 @@
"tags": "esri world basemap gcs v2, country, countries, state, province, cities, city, towns, town, lakes, lake, parks, park, airports, airport",
"format": "application/x-protobuf",
"type": "indexedVector",
- "disableSnapshot": true,
+ "disableGIF": true,
"layergroup": "Reference",
"wrapX": true,
"noTransition": true,
diff --git a/config/default/common/config/wv.json/layers/reference/esri/World_Imagery.json b/config/default/common/config/wv.json/layers/reference/esri/World_Imagery.json
index 2452a9b7d..c440e46d7 100644
--- a/config/default/common/config/wv.json/layers/reference/esri/World_Imagery.json
+++ b/config/default/common/config/wv.json/layers/reference/esri/World_Imagery.json
@@ -9,8 +9,9 @@
"group": "baselayers",
"layergroup": "Reference",
"format": "image/png",
- "type": "esriMapServer",
"disableSnapshot": true,
+ "disableGIF": true,
+ "type": "esriMapServer",
"wrapX": false,
"projections": {
"geographic": {
diff --git a/config/default/common/config/wv.json/layers/staqs/STAQS_G-III_Flight_Track.json b/config/default/common/config/wv.json/layers/staqs/STAQS_G-III_Flight_Track.json
index 53cb187d1..e61e01326 100644
--- a/config/default/common/config/wv.json/layers/staqs/STAQS_G-III_Flight_Track.json
+++ b/config/default/common/config/wv.json/layers/staqs/STAQS_G-III_Flight_Track.json
@@ -11,7 +11,7 @@
"ongoing": false,
"dataAvailability": "dd",
"disableCharting": true,
- "disableSnapshot": true,
+ "disableGIF": true,
"disableCustomPalettes": true,
"layergroup": "Suborbital Flight Tracks",
"vectorStyle": {
diff --git a/config/default/common/config/wv.json/layers/staqs/STAQS_G-V_Flight_Track.json b/config/default/common/config/wv.json/layers/staqs/STAQS_G-V_Flight_Track.json
index 26d4c037a..f33e7d9e0 100644
--- a/config/default/common/config/wv.json/layers/staqs/STAQS_G-V_Flight_Track.json
+++ b/config/default/common/config/wv.json/layers/staqs/STAQS_G-V_Flight_Track.json
@@ -11,7 +11,7 @@
"ongoing": false,
"dataAvailability": "dd",
"disableCharting": true,
- "disableSnapshot": true,
+ "disableGIF": true,
"disableCustomPalettes": true,
"layergroup": "Suborbital Flight Tracks",
"vectorStyle": {
diff --git a/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_Cloud_Cloud_Fraction_Total_Granule.json b/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_Cloud_Cloud_Fraction_Total_Granule.json
index 828379e66..1deb7c1eb 100644
--- a/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_Cloud_Cloud_Fraction_Total_Granule.json
+++ b/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_Cloud_Cloud_Fraction_Total_Granule.json
@@ -13,7 +13,7 @@
"count": 1,
"dataAvailability": "dd",
"startDate": "2023-08-02T15:12:49Z",
- "disableSnapshot": true,
+ "disableGIF": true,
"shiftadjacentdays": false
}
}
diff --git a/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_Cloud_Cloud_Pressure_Total_Granule.json b/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_Cloud_Cloud_Pressure_Total_Granule.json
index 3668a9c4a..dba0c27a2 100644
--- a/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_Cloud_Cloud_Pressure_Total_Granule.json
+++ b/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_Cloud_Cloud_Pressure_Total_Granule.json
@@ -13,7 +13,7 @@
"count": 1,
"dataAvailability": "dd",
"startDate": "2023-08-02T15:12:49Z",
- "disableSnapshot": true,
+ "disableGIF": true,
"shiftadjacentdays": false
}
}
diff --git a/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_Formaldehyde_Vertical_Column_Granule.json b/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_Formaldehyde_Vertical_Column_Granule.json
index c389aada7..3e8a0d890 100644
--- a/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_Formaldehyde_Vertical_Column_Granule.json
+++ b/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_Formaldehyde_Vertical_Column_Granule.json
@@ -13,7 +13,7 @@
"count": 1,
"dataAvailability": "dd",
"startDate": "2023-08-02T15:12:49Z",
- "disableSnapshot": true,
+ "disableGIF": true,
"shiftadjacentdays": false
}
}
diff --git a/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_NO2_Vertical_Column_Stratosphere_Granule.json b/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_NO2_Vertical_Column_Stratosphere_Granule.json
index 910e0a0cd..89cdeba74 100644
--- a/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_NO2_Vertical_Column_Stratosphere_Granule.json
+++ b/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_NO2_Vertical_Column_Stratosphere_Granule.json
@@ -13,7 +13,7 @@
"count": 1,
"dataAvailability": "dd",
"startDate": "2023-08-02T15:12:49Z",
- "disableSnapshot": true,
+ "disableGIF": true,
"shiftadjacentdays": false
}
}
diff --git a/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_NO2_Vertical_Column_Troposphere_Granule.json b/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_NO2_Vertical_Column_Troposphere_Granule.json
index 28d34e9ab..7deb80d33 100644
--- a/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_NO2_Vertical_Column_Troposphere_Granule.json
+++ b/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_NO2_Vertical_Column_Troposphere_Granule.json
@@ -13,7 +13,7 @@
"count": 1,
"dataAvailability": "dd",
"startDate": "2023-08-02T15:12:49Z",
- "disableSnapshot": true,
+ "disableGIF": true,
"shiftadjacentdays": false
}
}
diff --git a/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_Ozone_Cloud_Fraction_Granule.json b/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_Ozone_Cloud_Fraction_Granule.json
index 14c1e0951..6bc05b30d 100644
--- a/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_Ozone_Cloud_Fraction_Granule.json
+++ b/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_Ozone_Cloud_Fraction_Granule.json
@@ -13,7 +13,7 @@
"count": 1,
"dataAvailability": "dd",
"startDate": "2023-08-02T15:12:49Z",
- "disableSnapshot": true,
+ "disableGIF": true,
"shiftadjacentdays": false
}
}
diff --git a/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_Ozone_Column_Amount_Granule.json b/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_Ozone_Column_Amount_Granule.json
index b01409b6e..045bc0a1d 100644
--- a/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_Ozone_Column_Amount_Granule.json
+++ b/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_Ozone_Column_Amount_Granule.json
@@ -13,7 +13,7 @@
"count": 1,
"dataAvailability": "dd",
"startDate": "2023-08-02T15:12:49Z",
- "disableSnapshot": true,
+ "disableGIF": true,
"shiftadjacentdays": false
}
}
diff --git a/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_Ozone_Profile_Total_Column_Granule.json b/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_Ozone_Profile_Total_Column_Granule.json
index 789e1391a..e00a92750 100644
--- a/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_Ozone_Profile_Total_Column_Granule.json
+++ b/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_Ozone_Profile_Total_Column_Granule.json
@@ -12,7 +12,7 @@
"period": "subdaily",
"count": 1,
"dataAvailability": "dd",
- "disableSnapshot": true,
+ "disableGIF": true,
"shiftadjacentdays": false
}
}
diff --git a/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_Ozone_Profile_Troposphere_Column_Granule.json b/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_Ozone_Profile_Troposphere_Column_Granule.json
index 1c31cdaf9..add1b0dc8 100644
--- a/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_Ozone_Profile_Troposphere_Column_Granule.json
+++ b/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_Ozone_Profile_Troposphere_Column_Granule.json
@@ -12,7 +12,7 @@
"period": "subdaily",
"count": 1,
"dataAvailability": "dd",
- "disableSnapshot": true,
+ "disableGIF": true,
"shiftadjacentdays": false
}
}
diff --git a/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_Ozone_UV_Aerosol_Index_Granule.json b/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_Ozone_UV_Aerosol_Index_Granule.json
index ca6b2c5ca..725112a37 100644
--- a/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_Ozone_UV_Aerosol_Index_Granule.json
+++ b/config/default/common/config/wv.json/layers/tempo/TEMPO_L2_Ozone_UV_Aerosol_Index_Granule.json
@@ -13,7 +13,7 @@
"count": 1,
"dataAvailability": "dd",
"startDate": "2023-08-02T15:12:49Z",
- "disableSnapshot": true,
+ "disableGIF": true,
"shiftadjacentdays": false
}
}
diff --git a/config/default/common/config/wv.json/layers/tracer/TRACER-AQ_G-V_Flight_Track.json b/config/default/common/config/wv.json/layers/tracer/TRACER-AQ_G-V_Flight_Track.json
index 0e5b851a7..6f326edd8 100644
--- a/config/default/common/config/wv.json/layers/tracer/TRACER-AQ_G-V_Flight_Track.json
+++ b/config/default/common/config/wv.json/layers/tracer/TRACER-AQ_G-V_Flight_Track.json
@@ -10,7 +10,7 @@
"tags": "vector tracer",
"ongoing": false,
"disableCharting": true,
- "disableSnapshot": true,
+ "disableGIF": true,
"dataAvailability": "dd",
"layergroup": "Suborbital Flight Tracks",
"vectorStyle": {
diff --git a/config/default/common/config/wv.json/layers/wdpa/World_Database_on_Protected_Areas.json b/config/default/common/config/wv.json/layers/wdpa/World_Database_on_Protected_Areas.json
index 132361914..6e2d54d58 100644
--- a/config/default/common/config/wv.json/layers/wdpa/World_Database_on_Protected_Areas.json
+++ b/config/default/common/config/wv.json/layers/wdpa/World_Database_on_Protected_Areas.json
@@ -12,6 +12,7 @@
"format": "image/png",
"type": "xyz",
"disableSnapshot": true,
+ "disableGIF": true,
"layergroup": "Reference",
"wrapX": true,
"maxZoom": 12,
diff --git a/e2e/features/global-unit/coordinate-format-test.spec.js b/e2e/features/global-unit/coordinate-format-test.spec.js
index 2abe38e35..016b3440d 100644
--- a/e2e/features/global-unit/coordinate-format-test.spec.js
+++ b/e2e/features/global-unit/coordinate-format-test.spec.js
@@ -28,7 +28,7 @@ test('Open page', async () => {
test('Change coordinates format from coordinate case updates global settings coordinate format', async ({ browserName }) => {
test.skip(browserName === 'firefox', 'firefox cant find button')
- await page.locator('canvas').click()
+ await page.locator('canvas').nth(1).click()
await page.locator('#ol-coords-case').click()
await page.getByRole('button', { name: 'Information' }).click()
await page.getByRole('button', { name: 'Settings' }).click()
diff --git a/e2e/features/image-download/download-2-test.spec.js b/e2e/features/image-download/download-2-test.spec.js
new file mode 100644
index 000000000..1d8c9d457
--- /dev/null
+++ b/e2e/features/image-download/download-2-test.spec.js
@@ -0,0 +1,218 @@
+// @ts-check
+const { test, expect } = require('@playwright/test')
+const {
+ openImageDownloadPanel,
+ clickDownload,
+ closeModal
+} = require('../../test-utils/hooks/wvHooks')
+const { joinUrl } = require('../../test-utils/hooks/basicHooks')
+const fs = require('fs')
+const path = require('path')
+
+/** @type {import('@playwright/test').Page} */
+let page
+/** @type {Promise<import("playwright-core").Download>} */
+let downloadPromise
+
+const downloadDir = 'test-downloads'
+
+test.beforeAll(() => {
+ if (!fs.existsSync(downloadDir)) {
+ fs.mkdirSync(downloadDir)
+ }
+})
+
+test.beforeEach(async ({ browser }) => {
+ page = await browser.newPage()
+ downloadPromise = page.waitForEvent('download')
+})
+
+test.afterEach(async () => {
+ await page.close()
+})
+
+test.afterAll(() => {
+ if (fs.existsSync(downloadDir)) {
+ fs.rmdirSync(downloadDir, { recursive: true })
+ }
+})
+
+test('download KMZ format with larger area', async () => {
+ test.setTimeout(200_500)
+ const largeAreaParams = [
+ 'l=MODIS_Terra_CorrectedReflectance_TrueColor',
+ 'v=-10,-10,10,10', // Larger viewport
+ 't=2018-06-01'
+ ]
+
+ const url = await joinUrl(largeAreaParams, null)
+ await page.goto(url)
+ await closeModal(page)
+ await openImageDownloadPanel(page)
+
+ // Change format to KMZ
+ const formatSelect = page.locator('#wv-image-format')
+ await formatSelect.selectOption('application/vnd.google-earth.kmz')
+
+ // Set resolution to 1km for larger area
+ const resolutionSelect = page.locator('#wv-image-resolution')
+ await resolutionSelect.selectOption('1000')
+
+ await clickDownload(page)
+ await expect(page.locator('.wv-snapshot-progress-dialog')).toBeVisible()
+
+ const download = await downloadPromise
+ const suggestedFilename = download.suggestedFilename()
+ await expect(suggestedFilename).toMatch('snapshot-2018-06-01.kmz')
+
+ const filePath = path.join(downloadDir, suggestedFilename)
+ await download.saveAs(filePath)
+
+ expect(fs.existsSync(filePath)).toBeTruthy()
+ const fileStats = fs.statSync(filePath)
+ expect(fileStats.size).toBeGreaterThan(0)
+
+ fs.unlinkSync(filePath)
+})
+
+test('download with different date and layers', async () => {
+ test.setTimeout(200_500)
+ const multiLayerParams = [
+ 'l=MODIS_Terra_CorrectedReflectance_TrueColor,MODIS_Aqua_CorrectedReflectance_TrueColor',
+ 'v=-5,-5,5,5',
+ 't=2020-01-15'
+ ]
+
+ const url = await joinUrl(multiLayerParams, null)
+ await page.goto(url)
+ await closeModal(page)
+ await openImageDownloadPanel(page)
+
+ await clickDownload(page)
+ await expect(page.locator('.wv-snapshot-progress-dialog')).toBeVisible()
+
+ const download = await downloadPromise
+ const suggestedFilename = download.suggestedFilename()
+ await expect(suggestedFilename).toMatch('snapshot-2020-01-15.jpeg')
+
+ const filePath = path.join(downloadDir, suggestedFilename)
+ await download.saveAs(filePath)
+
+ expect(fs.existsSync(filePath)).toBeTruthy()
+ const fileStats = fs.statSync(filePath)
+ expect(fileStats.size).toBeGreaterThan(0)
+
+ fs.unlinkSync(filePath)
+})
+
+test('download Arctic projection with PNG format', async () => {
+ test.setTimeout(200_500)
+ const arcticParams = [
+ 'p=arctic',
+ 'l=MODIS_Terra_CorrectedReflectance_TrueColor',
+ 'v=-1000000,-1000000,1000000,1000000',
+ 't=2018-06-01'
+ ]
+
+ const url = await joinUrl(arcticParams, null)
+ await page.goto(url)
+ await closeModal(page)
+ await openImageDownloadPanel(page)
+
+ // Change format to PNG (KMZ not available in polar projections)
+ const formatSelect = page.locator('#wv-image-format')
+ await formatSelect.selectOption('image/png')
+
+ // Set appropriate resolution for Arctic
+ const resolutionSelect = page.locator('#wv-image-resolution')
+ await resolutionSelect.selectOption('1000')
+
+ await clickDownload(page)
+ await expect(page.locator('.wv-snapshot-progress-dialog')).toBeVisible()
+
+ const download = await downloadPromise
+ const suggestedFilename = download.suggestedFilename()
+ await expect(suggestedFilename).toMatch('snapshot-2018-06-01.png')
+
+ const filePath = path.join(downloadDir, suggestedFilename)
+ await download.saveAs(filePath)
+
+ expect(fs.existsSync(filePath)).toBeTruthy()
+ const fileStats = fs.statSync(filePath)
+ expect(fileStats.size).toBeGreaterThan(0)
+
+ fs.unlinkSync(filePath)
+})
+
+test('download with high resolution (60m)', async () => {
+ test.setTimeout(200_500)
+ const highResParams = [
+ 'l=MODIS_Terra_CorrectedReflectance_TrueColor',
+ 'v=-0.5,-0.5,0.5,0.5', // Small area for high resolution
+ 't=2018-06-01'
+ ]
+
+ const url = await joinUrl(highResParams, null)
+ await page.goto(url)
+ await closeModal(page)
+ await openImageDownloadPanel(page)
+
+ // Set high resolution
+ const resolutionSelect = page.locator('#wv-image-resolution')
+ await resolutionSelect.selectOption('60')
+
+ await clickDownload(page)
+ await expect(page.locator('.wv-snapshot-progress-dialog')).toBeVisible()
+
+ const download = await downloadPromise
+ const suggestedFilename = download.suggestedFilename()
+ await expect(suggestedFilename).toMatch('snapshot-2018-06-01.jpeg')
+
+ const filePath = path.join(downloadDir, suggestedFilename)
+ await download.saveAs(filePath)
+
+ expect(fs.existsSync(filePath)).toBeTruthy()
+ const fileStats = fs.statSync(filePath)
+ expect(fileStats.size).toBeGreaterThan(0)
+
+ fs.unlinkSync(filePath)
+})
+
+test('download with Antarctic projection and GeoTIFF', async () => {
+ test.setTimeout(200_500)
+ const antarcticParams = [
+ 'p=antarctic',
+ 'l=MODIS_Terra_CorrectedReflectance_TrueColor',
+ 'v=-1000000,-1000000,1000000,1000000',
+ 't=2018-06-01'
+ ]
+
+ const url = await joinUrl(antarcticParams, null)
+ await page.goto(url)
+ await closeModal(page)
+ await openImageDownloadPanel(page)
+
+ // Change format to GeoTIFF
+ const formatSelect = page.locator('#wv-image-format')
+ await formatSelect.selectOption('image/tiff')
+
+ // Set resolution to 500m
+ const resolutionSelect = page.locator('#wv-image-resolution')
+ await resolutionSelect.selectOption('500')
+
+ await clickDownload(page)
+ await expect(page.locator('.wv-snapshot-progress-dialog')).toBeVisible()
+
+ const download = await downloadPromise
+ const suggestedFilename = download.suggestedFilename()
+ await expect(suggestedFilename).toMatch('snapshot-2018-06-01.tif')
+
+ const filePath = path.join(downloadDir, suggestedFilename)
+ await download.saveAs(filePath)
+
+ expect(fs.existsSync(filePath)).toBeTruthy()
+ const fileStats = fs.statSync(filePath)
+ expect(fileStats.size).toBeGreaterThan(0)
+
+ fs.unlinkSync(filePath)
+})
diff --git a/e2e/features/image-download/download-test.spec.js b/e2e/features/image-download/download-test.spec.js
new file mode 100644
index 000000000..028a6cd3c
--- /dev/null
+++ b/e2e/features/image-download/download-test.spec.js
@@ -0,0 +1,206 @@
+// @ts-check
+const { test, expect } = require('@playwright/test')
+const {
+ openImageDownloadPanel,
+ clickDownload,
+ closeModal
+} = require('../../test-utils/hooks/wvHooks')
+const { joinUrl } = require('../../test-utils/hooks/basicHooks')
+const fs = require('fs')
+const path = require('path')
+
+/** @type {import('@playwright/test').Page} */
+let page
+/** @type {Promise<import("playwright-core").Download>} */
+let downloadPromise
+
+const startParams = [
+ 'l=MODIS_Terra_CorrectedReflectance_TrueColor',
+ 'v=-1,-1,1,1',
+ 't=2018-06-01'
+]
+const subdailyParams = [
+ 'l=TEMPO_L2_Formaldehyde_Vertical_Column_Granule(count=1)',
+ 'v=-1,-1,1,1',
+ 't=2024-06-01'
+]
+const downloadDir = 'test-downloads'
+
+test.beforeAll(() => {
+ if (!fs.existsSync(downloadDir)) {
+ fs.mkdirSync(downloadDir)
+ }
+})
+
+test.beforeEach(async ({ browser }) => {
+ page = await browser.newPage()
+ downloadPromise = page.waitForEvent('download')
+})
+
+test.afterEach(async () => {
+ await page.close()
+})
+
+test.afterAll(() => {
+ if (fs.existsSync(downloadDir)) {
+ fs.rmdirSync(downloadDir, { recursive: true })
+ }
+})
+
+test('download button downloads an image', async () => {
+ test.setTimeout(200_500)
+ const url = await joinUrl(startParams, null)
+ await page.goto(url)
+ await closeModal(page)
+ await openImageDownloadPanel(page)
+
+ // Start download and verify progress indicator appears
+ await clickDownload(page)
+ await expect(page.locator('.wv-snapshot-progress-dialog')).toBeVisible()
+
+ const download = await downloadPromise
+ const suggestedFilename = download.suggestedFilename()
+ await expect(suggestedFilename).toMatch('snapshot-2018-06-01.jpeg')
+
+ const filePath = path.join(downloadDir, suggestedFilename)
+
+ // Save the downloaded file
+ await download.saveAs(filePath)
+
+ // Assert that the file exists
+ expect(fs.existsSync(filePath)).toBeTruthy()
+
+ // Check file size is greater than 0
+ const fileStats = fs.statSync(filePath)
+ expect(fileStats.size).toBeGreaterThan(0)
+
+ // Clean up the downloaded file (optional)
+ fs.unlinkSync(filePath)
+})
+
+test('download PNG format with different resolution', async () => {
+ test.setTimeout(200_500)
+ const url = await joinUrl(startParams, null)
+ await page.goto(url)
+ await closeModal(page)
+ await openImageDownloadPanel(page)
+
+ // Change format to PNG
+ const formatSelect = page.locator('#wv-image-format')
+ await formatSelect.selectOption('image/png')
+
+ // Change resolution to 250m
+ const resolutionSelect = page.locator('#wv-image-resolution')
+ await resolutionSelect.selectOption('250')
+
+ await clickDownload(page)
+ await expect(page.locator('.wv-snapshot-progress-dialog')).toBeVisible()
+
+ const download = await downloadPromise
+ const suggestedFilename = download.suggestedFilename()
+ await expect(suggestedFilename).toMatch('snapshot-2018-06-01.png')
+
+ const filePath = path.join(downloadDir, suggestedFilename)
+ await download.saveAs(filePath)
+
+ expect(fs.existsSync(filePath)).toBeTruthy()
+ const fileStats = fs.statSync(filePath)
+ expect(fileStats.size).toBeGreaterThan(0)
+
+ fs.unlinkSync(filePath)
+})
+
+test('download GeoTIFF with worldfile enabled', async () => {
+ test.setTimeout(200_500)
+ const url = await joinUrl(startParams, null)
+ await page.goto(url)
+ await closeModal(page)
+ await openImageDownloadPanel(page)
+
+ // Change format to GeoTIFF
+ const formatSelect = page.locator('#wv-image-format')
+ await formatSelect.selectOption('image/tiff')
+
+ // Enable worldfile
+ const worldfileCheckbox = page.locator('#wv-image-worldfile')
+ await worldfileCheckbox.selectOption('1')
+
+ await clickDownload(page)
+ await expect(page.locator('.wv-snapshot-progress-dialog')).toBeVisible()
+
+ const download = await downloadPromise
+ const suggestedFilename = download.suggestedFilename()
+ await expect(suggestedFilename).toMatch('snapshot-2018-06-01.tif')
+
+ const filePath = path.join(downloadDir, suggestedFilename)
+ await download.saveAs(filePath)
+
+ expect(fs.existsSync(filePath)).toBeTruthy()
+ const fileStats = fs.statSync(filePath)
+ expect(fileStats.size).toBeGreaterThan(0)
+
+ fs.unlinkSync(filePath)
+})
+
+test('download GeoTIFF with entire globe selected', async () => {
+ test.setTimeout(200_500)
+ const url = await joinUrl(startParams, null)
+ await page.goto(url)
+ await closeModal(page)
+ await openImageDownloadPanel(page)
+
+ // Change format to GeoTIFF
+ const formatSelect = page.locator('#wv-image-format')
+ await formatSelect.selectOption('image/tiff')
+
+ const resolutionSelect = page.locator('#wv-image-resolution')
+ await resolutionSelect.selectOption('5000')
+
+ // Select entire globe
+ const globeCheckbox = page.locator('#image-global-cb')
+ await globeCheckbox.click()
+
+ await clickDownload(page)
+ await expect(page.locator('.wv-snapshot-progress-dialog')).toBeVisible()
+
+ const download = await downloadPromise
+ const suggestedFilename = download.suggestedFilename()
+ await expect(suggestedFilename).toMatch('snapshot-2018-06-01.tif')
+
+ const filePath = path.join(downloadDir, suggestedFilename)
+ await download.saveAs(filePath)
+
+ expect(fs.existsSync(filePath)).toBeTruthy()
+ const fileStats = fs.statSync(filePath)
+ expect(fileStats.size).toBeGreaterThan(0)
+
+ fs.unlinkSync(filePath)
+})
+
+test('download PNG format with subdaily layer', async () => {
+ test.setTimeout(200_500)
+ const url = await joinUrl(subdailyParams, null)
+ await page.goto(url)
+ await closeModal(page)
+ await openImageDownloadPanel(page)
+
+ // Change format to PNG
+ const formatSelect = page.locator('#wv-image-format')
+ await formatSelect.selectOption('image/png')
+
+ await clickDownload(page)
+ await expect(page.locator('.wv-snapshot-progress-dialog')).toBeVisible()
+
+ const download = await downloadPromise
+ const suggestedFilename = download.suggestedFilename()
+ await expect(suggestedFilename).toMatch('snapshot-2024-06-01T00_00_59.000Z.png')
+
+ const filePath = path.join(downloadDir, suggestedFilename)
+ await download.saveAs(filePath)
+
+ expect(fs.existsSync(filePath)).toBeTruthy()
+ const fileStats = fs.statSync(filePath)
+ expect(fileStats.size).toBeGreaterThan(0)
+
+ fs.unlinkSync(filePath)
+})
diff --git a/e2e/features/image-download/formats-test.spec.js b/e2e/features/image-download/formats-test.spec.js
index 73c7b5c4f..46c179a95 100644
--- a/e2e/features/image-download/formats-test.spec.js
+++ b/e2e/features/image-download/formats-test.spec.js
@@ -8,7 +8,6 @@ const {
closeModal
} = require('../../test-utils/hooks/wvHooks')
const {
- getAttribute,
joinUrl,
selectOption
} = require('../../test-utils/hooks/basicHooks')
@@ -18,8 +17,7 @@ let page
const startParams = [
'l=MODIS_Terra_CorrectedReflectance_TrueColor',
'v=-1,-1,1,1',
- 't=2018-06-01',
- 'imageDownload='
+ 't=2018-06-01'
]
test.describe.configure({ mode: 'serial' })
@@ -37,40 +35,92 @@ test('JPEG is the default', async () => {
await page.goto(url)
await closeModal(page)
await openImageDownloadPanel(page)
+
+ // Verify JPEG is selected as default format
+ const formatSelect = page.locator('#wv-image-format')
+ await expect(formatSelect).toHaveValue('image/jpeg')
+
+ // Start download and verify progress indicator appears
await clickDownload(page)
- const urlAttribute = await getAttribute(page, '#wv-image-download-url', 'url')
- expect(urlAttribute).not.toContain('WORLDFILE')
- expect(urlAttribute).toContain('FORMAT=image/jpeg')
+ await expect(page.locator('.wv-snapshot-progress-dialog')).toBeVisible()
+
+ // Wait for completion or cancel after reasonable time
+ await Promise.race([
+ page.locator('.wv-snapshot-progress-dialog').waitFor({ state: 'hidden', timeout: 30000 }),
+ page.locator('button:text("Cancel")').click()
+ ])
+
await closeImageDownloadPanel(page)
})
test('Add a worldfile', async () => {
await openImageDownloadPanel(page)
+
+ // Enable worldfile option
await selectOption(page, '#wv-image-worldfile', 1)
+ const worldfileSelect = page.locator('#wv-image-worldfile')
+ await expect(worldfileSelect).toHaveValue('1')
+
+ // Start download and verify progress indicator appears
await clickDownload(page)
- const urlAttribute = await getAttribute(page, '#wv-image-download-url', 'url')
- expect(urlAttribute).toContain('WORLDFILE=true')
+ await expect(page.locator('.wv-snapshot-progress-dialog')).toBeVisible()
+
+ // Wait for completion or cancel after reasonable time
+ await Promise.race([
+ page.locator('.wv-snapshot-progress-dialog').waitFor({ state: 'hidden', timeout: 30000 }),
+ page.locator('button:text("Cancel")').click()
+ ])
+
+ // Reset worldfile option
await selectOption(page, '#wv-image-worldfile', 0)
await closeImageDownloadPanel(page)
})
test('Select PNG', async () => {
await openImageDownloadPanel(page)
+
+ // Select PNG format
await selectOption(page, '#wv-image-format', 1)
+ const formatSelect = page.locator('#wv-image-format')
+ await expect(formatSelect).toHaveValue('image/png')
+
+ // Start download and verify progress indicator appears
await clickDownload(page)
- const urlAttribute = await getAttribute(page, '#wv-image-download-url', 'url')
- expect(urlAttribute).toContain('FORMAT=image/png')
+ await expect(page.locator('.wv-snapshot-progress-dialog')).toBeVisible()
+
+ // Wait for completion or cancel after reasonable time
+ await Promise.race([
+ page.locator('.wv-snapshot-progress-dialog').waitFor({ state: 'hidden', timeout: 30000 }),
+ page.locator('button:text("Cancel")').click()
+ ])
+
await closeImageDownloadPanel(page)
})
-test('Switch to geographic, select KMZ, switch to arctic, is PNG', async () => {
+test('Switch to geographic, select KMZ, switch to arctic, is JPEG', async () => {
await switchProjections(page, 'geographic')
await openImageDownloadPanel(page)
+
+ // Select KMZ format
await selectOption(page, '#wv-image-format', 3)
+ const formatSelect = page.locator('#wv-image-format')
+ await expect(formatSelect).toHaveValue('application/vnd.google-earth.kmz')
+
await closeImageDownloadPanel(page)
await switchProjections(page, 'arctic')
await openImageDownloadPanel(page)
+
+ // Verify format defaulted back to JPEG in arctic projection
+ const arcticFormatSelect = page.locator('#wv-image-format')
+ await expect(arcticFormatSelect).toHaveValue('image/jpeg')
+
+ // Start download and verify progress indicator appears
await clickDownload(page)
- const urlAttribute = await getAttribute(page, '#wv-image-download-url', 'url')
- expect(urlAttribute).toContain('FORMAT=image/jpeg')
+ await expect(page.locator('.wv-snapshot-progress-dialog')).toBeVisible()
+
+ // Wait for completion or cancel after reasonable time
+ await Promise.race([
+ page.locator('.wv-snapshot-progress-dialog').waitFor({ state: 'hidden', timeout: 30000 }),
+ page.locator('button:text("Cancel")').click()
+ ])
})
diff --git a/e2e/features/image-download/global-select-test.spec.js b/e2e/features/image-download/global-select-test.spec.js
index 7d9f2ee20..e48028e43 100644
--- a/e2e/features/image-download/global-select-test.spec.js
+++ b/e2e/features/image-download/global-select-test.spec.js
@@ -12,8 +12,7 @@ const startParams = [
'p=geographic',
'v=-180,-90,180,90',
'l=MODIS_Terra_CorrectedReflectance_TrueColor',
- 't=2018-06-01',
- 'imageDownload='
+ 't=2018-06-01'
]
const defaultCoords = '180.0000'
diff --git a/e2e/features/image-download/initial-state-test.spec.js b/e2e/features/image-download/initial-state-test.spec.js
index 340423d9b..f0eb95d54 100644
--- a/e2e/features/image-download/initial-state-test.spec.js
+++ b/e2e/features/image-download/initial-state-test.spec.js
@@ -16,7 +16,7 @@ let selectors
const expectedResolutions = '30m60m125m250m500m1km5km10km'
const expectedFormats = 'JPEGPNGGeoTIFFKMZ'
const expectedWorldFile = 'NoYes'
-const expectedSize = '8200px x 8200px'
+const expectedSize = '16384px x 16384px'
const expectedPolarFormats = 'JPEGPNGGeoTIFF'
test.describe.configure({ mode: 'serial' })
diff --git a/e2e/features/image-download/layers-test.spec.js b/e2e/features/image-download/layers-test.spec.js
index b9e1ace73..a1894978c 100644
--- a/e2e/features/image-download/layers-test.spec.js
+++ b/e2e/features/image-download/layers-test.spec.js
@@ -1,20 +1,22 @@
// @ts-check
const { test, expect } = require('@playwright/test')
const { openImageDownloadPanel, clickDownload, closeModal } = require('../../test-utils/hooks/wvHooks')
-const { joinUrl, getAttribute } = require('../../test-utils/hooks/basicHooks')
+const { joinUrl } = require('../../test-utils/hooks/basicHooks')
/** @type {import('@playwright/test').Page} */
let page
+/** @type {Promise<import("playwright-core").Download>} */
+let downloadPromise
const startParams = [
- 'v=-180,-90,180,90',
- 't=2018-06-01',
- 'imageDownload='
+ 'v=-1,-1,1,1',
+ 't=2018-06-01'
]
test.describe.configure({ mode: 'serial' })
test.beforeEach(async ({ browser }) => {
page = await browser.newPage()
+ downloadPromise = page.waitForEvent('download')
})
test.afterEach(async () => {
@@ -26,22 +28,57 @@ test('List layers in draw order', async () => {
await page.goto(url)
await closeModal(page)
await openImageDownloadPanel(page)
+
+ // Verify the layers are loaded by checking they exist in the layer list
+ const layerItems = page.locator('li.layer-visible')
+ await expect(layerItems).toHaveCount(3)
+
+ // Start download and verify progress indicator appears
await clickDownload(page)
- const urlAttribute = await getAttribute(page, '#wv-image-download-url', 'url')
- expect(urlAttribute).toContain('LAYERS=MODIS_Terra_CorrectedReflectance_TrueColor')
+
+ const progressDialog = page.locator('.wv-snapshot-progress-overlay')
+ await expect(progressDialog).toBeVisible()
+
+ const cancelButton = page.locator('#wv-snapshot-cancel-button')
+ await expect(cancelButton).toBeVisible()
+
+ // Wait for either the download to start or the progress dialog to disappear (timeout after 20s)
+ try {
+ await Promise.race([
+ downloadPromise,
+ progressDialog.waitFor({ state: 'detached', timeout: 200_000 }),
+ cancelButton.click()
+ ])
+ } catch (e) {
+ throw new Error('Snapshot download did not complete or progress dialog did not disappear in time')
+ }
})
-test('Move AOD over the reference features', async ({ browserName }) => {
- test.skip(browserName === 'firefox', 'firefox fails this test for unknown reasons')
+test('Move AOD over the reference features', async () => {
const url = await joinUrl(startParams, '&l=MODIS_Terra_CorrectedReflectance_TrueColor,MODIS_Terra_Aerosol,Reference_Features_15m')
await page.goto(url)
- await page.waitForTimeout(1000)
await closeModal(page)
- await page.waitForTimeout(1000)
await openImageDownloadPanel(page)
+
+ // Start download and verify progress indicator appears
await clickDownload(page)
- const urlAttribute = await getAttribute(page, '#wv-image-download-url', 'url')
- expect(urlAttribute).toContain('LAYERS=MODIS_Terra_CorrectedReflectance_TrueColor,Reference_Features_15m,MODIS_Terra_Aerosol')
+
+ const progressDialog = page.locator('.wv-snapshot-progress-overlay')
+ await expect(progressDialog).toBeVisible()
+
+ const cancelButton = page.locator('#wv-snapshot-cancel-button')
+ await expect(cancelButton).toBeVisible()
+
+ // Wait for either the download to start or the progress dialog to disappear (timeout after 20s)
+ try {
+ await Promise.race([
+ downloadPromise,
+ progressDialog.waitFor({ state: 'detached', timeout: 200_000 }),
+ cancelButton.click()
+ ])
+ } catch (e) {
+ throw new Error('Snapshot download did not complete or progress dialog did not disappear in time')
+ }
})
test('Do not include obscured layers', async () => {
@@ -49,9 +86,30 @@ test('Do not include obscured layers', async () => {
await page.goto(url)
await closeModal(page)
await openImageDownloadPanel(page)
+
+ // Verify layers are loaded
+ const layerItems = page.locator('li.layer-visible')
+ await expect(layerItems).toHaveCount(3)
+
+ // Start download and verify progress indicator appears
await clickDownload(page)
- const urlAttribute = await getAttribute(page, '#wv-image-download-url', 'url')
- expect(urlAttribute).toContain('LAYERS=MODIS_Terra_CorrectedReflectance_TrueColor')
+
+ const progressDialog = page.locator('.wv-snapshot-progress-overlay')
+ await expect(progressDialog).toBeVisible()
+
+ const cancelButton = page.locator('#wv-snapshot-cancel-button')
+ await expect(cancelButton).toBeVisible()
+
+ // Wait for either the download to start or the progress dialog to disappear (timeout after 20s)
+ try {
+ await Promise.race([
+ downloadPromise,
+ progressDialog.waitFor({ state: 'detached', timeout: 200_000 }),
+ cancelButton.click()
+ ])
+ } catch (e) {
+ throw new Error('Snapshot download did not complete or progress dialog did not disappear in time')
+ }
})
test('Multiple base layers when one is semi-transparent', async () => {
@@ -59,8 +117,28 @@ test('Multiple base layers when one is semi-transparent', async () => {
await page.goto(url)
await closeModal(page)
await openImageDownloadPanel(page)
+
+ // Verify both layers are loaded
+ const layerItems = page.locator('li.layer-visible')
+ await expect(layerItems).toHaveCount(2)
+
+ // Start download and verify progress indicator appears
await clickDownload(page)
- const urlAttribute = await getAttribute(page, '#wv-image-download-url', 'url')
- expect(urlAttribute).toContain('LAYERS=MODIS_Aqua_CorrectedReflectance_TrueColor,MODIS_Terra_CorrectedReflectance_TrueColor')
- expect(urlAttribute).toContain('OPACITIES=,0.5')
+
+ const progressDialog = page.locator('.wv-snapshot-progress-overlay')
+ await expect(progressDialog).toBeVisible()
+
+ const cancelButton = page.locator('#wv-snapshot-cancel-button')
+ await expect(cancelButton).toBeVisible()
+
+ // Wait for either the download to start or the progress dialog to disappear (timeout after 20s)
+ try {
+ await Promise.race([
+ downloadPromise,
+ progressDialog.waitFor({ state: 'detached', timeout: 200_000 }),
+ cancelButton.click()
+ ])
+ } catch (e) {
+ throw new Error('Snapshot download did not complete or progress dialog did not disappear in time')
+ }
})
diff --git a/e2e/features/image-download/projection-test.spec.js b/e2e/features/image-download/projection-test.spec.js
index 90429ff01..69586b172 100644
--- a/e2e/features/image-download/projection-test.spec.js
+++ b/e2e/features/image-download/projection-test.spec.js
@@ -6,21 +6,25 @@ const {
clickDownload,
closeModal
} = require('../../test-utils/hooks/wvHooks')
-const { joinUrl, getAttribute } = require('../../test-utils/hooks/basicHooks')
+const { joinUrl } = require('../../test-utils/hooks/basicHooks')
const { switchProjections } = require('../../test-utils/hooks/wvHooks')
/** @type {import('@playwright/test').Page} */
let page
+/** @type {Promise<import("playwright-core").Download>} */
+let downloadPromise
+
const startParams = [
+ 'v=-1,-1,1,1',
'l=MODIS_Terra_CorrectedReflectance_TrueColor',
- 't=2018-06-01',
- 'imageDownload='
+ 't=2018-06-01'
]
test.describe.configure({ mode: 'serial' })
test.beforeAll(async ({ browser }) => {
page = await browser.newPage()
+ downloadPromise = page.waitForEvent('download')
})
test.afterAll(async () => {
@@ -32,26 +36,78 @@ test('Geographic is EPSG:4326', async () => {
await page.goto(url)
await closeModal(page)
await openImageDownloadPanel(page)
+
+ // Start download and verify progress indicator appears
await clickDownload(page)
- const urlAttribute = await getAttribute(page, '#wv-image-download-url', 'url')
- expect(urlAttribute).toContain('CRS=EPSG:4326')
+
+ const progressDialog = page.locator('.wv-snapshot-progress-overlay')
+ await expect(progressDialog).toBeVisible()
+
+ const cancelButton = page.locator('#wv-snapshot-cancel-button')
+ await expect(cancelButton).toBeVisible()
+
+ // Wait for either the download to start or the progress dialog to disappear (timeout after 20s)
+ try {
+ await Promise.race([
+ downloadPromise,
+ progressDialog.waitFor({ state: 'detached', timeout: 200_000 }),
+ cancelButton.click()
+ ])
+ } catch (e) {
+ throw new Error('Snapshot download did not complete or progress dialog did not disappear in time')
+ }
+
await closeImageDownloadPanel(page)
})
test('Arctic is EPSG:3413', async () => {
await switchProjections(page, 'arctic')
await openImageDownloadPanel(page)
+
+ // Start download and verify progress indicator appears
await clickDownload(page)
- const urlAttribute = await getAttribute(page, '#wv-image-download-url', 'url')
- expect(urlAttribute).toContain('CRS=EPSG:3413')
+ const progressDialog = page.locator('.wv-snapshot-progress-overlay')
+ await expect(progressDialog).toBeVisible()
+
+ const cancelButton = page.locator('#wv-snapshot-cancel-button')
+ await expect(cancelButton).toBeVisible()
+
+ // Wait for either the download to start or the progress dialog to disappear (timeout after 20s)
+ try {
+ await Promise.race([
+ downloadPromise,
+ progressDialog.waitFor({ state: 'detached', timeout: 200_000 }),
+ cancelButton.click()
+ ])
+ } catch (e) {
+ throw new Error('Snapshot download did not complete or progress dialog did not disappear in time')
+ }
+
await closeImageDownloadPanel(page)
})
test('Antarctic is EPSG:3031', async () => {
await switchProjections(page, 'antarctic')
await openImageDownloadPanel(page)
+
+ // Start download and verify progress indicator appears
await clickDownload(page)
- const urlAttribute = await getAttribute(page, '#wv-image-download-url', 'url')
- expect(urlAttribute).toContain('CRS=EPSG:3031')
+
+ const progressDialog = page.locator('.wv-snapshot-progress-overlay')
+ await expect(progressDialog).toBeVisible()
+
+ const cancelButton = page.locator('#wv-snapshot-cancel-button')
+ await expect(cancelButton).toBeVisible()
+
+ // Wait for either the download to start or the progress dialog to disappear (timeout after 20s)
+ try {
+ await Promise.race([
+ downloadPromise,
+ progressDialog.waitFor({ state: 'detached', timeout: 200_000 }),
+ cancelButton.click()
+ ])
+ } catch (e) {
+ throw new Error('Snapshot download did not complete or progress dialog did not disappear in time')
+ }
await closeImageDownloadPanel(page)
})
diff --git a/e2e/features/image-download/resolutions3413-test.spec.js b/e2e/features/image-download/resolutions3413-test.spec.js
index e3a8c3c72..c4ae8bbf2 100644
--- a/e2e/features/image-download/resolutions3413-test.spec.js
+++ b/e2e/features/image-download/resolutions3413-test.spec.js
@@ -8,7 +8,7 @@ const {
zoomIn,
closeModal
} = require('../../test-utils/hooks/wvHooks')
-const { joinUrl, getAttribute } = require('../../test-utils/hooks/basicHooks')
+const { joinUrl } = require('../../test-utils/hooks/basicHooks')
/** @type {import('@playwright/test').Page} */
let page
@@ -18,8 +18,7 @@ const startParams = [
'p=arctic',
'v=-4194304,-3145728,4194304,3145728',
'l=MODIS_Terra_CorrectedReflectance_TrueColor',
- 't=2018-06-01',
- 'imageDownload='
+ 't=2018-06-01'
]
test.describe.configure({ mode: 'serial' })
@@ -39,7 +38,7 @@ test('In the arctic, top zoom levels is 5km', async () => {
await page.goto(url)
await closeModal(page)
await openImageDownloadPanel(page)
- await expect(imageResolution).toHaveValue('20')
+ await expect(imageResolution).toHaveValue('5000')
await closeImageDownloadPanel(page)
})
@@ -47,11 +46,11 @@ test('Next two zooms are 1km', async () => {
const { imageResolution } = selectors
await zoomIn(page)
await openImageDownloadPanel(page)
- await expect(imageResolution).toHaveValue('4')
+ await expect(imageResolution).toHaveValue('1000')
await closeImageDownloadPanel(page)
await zoomIn(page)
await openImageDownloadPanel(page)
- await expect(imageResolution).toHaveValue('4')
+ await expect(imageResolution).toHaveValue('1000')
await closeImageDownloadPanel(page)
})
@@ -59,7 +58,7 @@ test('Next zoom is 500m', async () => {
const { imageResolution } = selectors
await zoomIn(page)
await openImageDownloadPanel(page)
- await expect(imageResolution).toHaveValue('2')
+ await expect(imageResolution).toHaveValue('500')
await closeImageDownloadPanel(page)
})
@@ -67,11 +66,11 @@ test('Next zoom is 250m', async () => {
const { imageResolution } = selectors
await zoomIn(page)
await openImageDownloadPanel(page)
- await expect(imageResolution).toHaveValue('1')
+ await expect(imageResolution).toHaveValue('250')
await closeImageDownloadPanel(page)
await zoomIn(page)
await openImageDownloadPanel(page)
- await expect(imageResolution).toHaveValue('1')
+ await expect(imageResolution).toHaveValue('250')
await closeImageDownloadPanel(page)
})
@@ -81,28 +80,37 @@ test('Last zoom level is 250m', async () => {
await zoomIn(page)
}
await openImageDownloadPanel(page)
- await expect(imageResolution).toHaveValue('1')
+ await expect(imageResolution).toHaveValue('250')
await closeImageDownloadPanel(page)
})
-test('Confirm bounding box integrity', async () => {
+test('Confirm bounding box integrity by testing snapshot functionality', async () => {
await openImageDownloadPanel(page)
+
+ const downloadPromise = page.waitForEvent('download')
+
+ // Verify the bounding box display is present
+ const bboxDisplay = page.locator('.wv-image-input-case')
+ await expect(bboxDisplay).toBeVisible()
+
+ // Start download and verify progress indicator appears
await clickDownload(page)
- const urlAttribute = await getAttribute(page, '#wv-image-download-url', 'url')
- const matcher = /BBOX=([^,]+),([^,]+),([^,]+),([^&]+)/
- const matches = matcher.exec(urlAttribute)
- if (matches !== null) {
- const x0 = Number.parseFloat(matches[1])
- const y0 = Number.parseFloat(matches[2])
- const x1 = Number.parseFloat(matches[3])
- const y1 = Number.parseFloat(matches[4])
- expect(x0).toBeLessThan(0)
- expect(x0).toBeGreaterThan(-20000)
- expect(y0).toBeLessThan(0)
- expect(y0).toBeGreaterThan(-20000)
- expect(x1).toBeGreaterThan(0)
- expect(x1).toBeLessThan(20000)
- expect(y1).toBeGreaterThan(0)
- expect(y1).toBeLessThan(20000)
+ const progressDialog = page.locator('.wv-snapshot-progress-overlay')
+ await expect(progressDialog).toBeVisible()
+
+ const cancelButton = page.locator('#wv-snapshot-cancel-button')
+ await expect(cancelButton).toBeVisible()
+
+ // Wait for either the download to start or the progress dialog to disappear (timeout after 20s)
+ try {
+ await Promise.race([
+ downloadPromise,
+ progressDialog.waitFor({ state: 'detached', timeout: 200_000 }),
+ cancelButton.click()
+ ])
+ } catch (e) {
+ throw new Error('Snapshot download did not complete or progress dialog did not disappear in time')
}
+
+ await closeImageDownloadPanel(page)
})
diff --git a/e2e/features/image-download/resolutions4326-test.spec.js b/e2e/features/image-download/resolutions4326-test.spec.js
index 6daf95c2d..44b1a2c35 100644
--- a/e2e/features/image-download/resolutions4326-test.spec.js
+++ b/e2e/features/image-download/resolutions4326-test.spec.js
@@ -8,7 +8,7 @@ const {
zoomIn,
closeModal
} = require('../../test-utils/hooks/wvHooks')
-const { joinUrl, getAttribute } = require('../../test-utils/hooks/basicHooks')
+const { joinUrl } = require('../../test-utils/hooks/basicHooks')
/** @type {import('@playwright/test').Page} */
let page
@@ -18,8 +18,7 @@ const startParams = [
'p=geographic',
'v=-180,-90,180,90',
'l=MODIS_Terra_CorrectedReflectance_TrueColor',
- 't=2018-06-01',
- 'imageDownload='
+ 't=2018-06-01'
]
test.describe.configure({ mode: 'serial' })
@@ -39,11 +38,11 @@ test('In geographic, top two zoom levels are 10km', async () => {
await page.goto(url)
await closeModal(page)
await openImageDownloadPanel(page)
- await expect(imageResolution).toHaveValue('40')
+ await expect(imageResolution).toHaveValue('10000')
await closeImageDownloadPanel(page)
await zoomIn(page)
await openImageDownloadPanel(page)
- await expect(imageResolution).toHaveValue('40')
+ await expect(imageResolution).toHaveValue('10000')
await closeImageDownloadPanel(page)
})
@@ -51,7 +50,7 @@ test('Next zoom is 5km', async () => {
const { imageResolution } = selectors
await zoomIn(page)
await openImageDownloadPanel(page)
- await expect(imageResolution).toHaveValue('20')
+ await expect(imageResolution).toHaveValue('5000')
await closeImageDownloadPanel(page)
})
@@ -59,11 +58,11 @@ test('Next two zooms are 1km', async () => {
const { imageResolution } = selectors
await zoomIn(page)
await openImageDownloadPanel(page)
- await expect(imageResolution).toHaveValue('4')
+ await expect(imageResolution).toHaveValue('1000')
await closeImageDownloadPanel(page)
await zoomIn(page)
await openImageDownloadPanel(page)
- await expect(imageResolution).toHaveValue('4')
+ await expect(imageResolution).toHaveValue('1000')
await closeImageDownloadPanel(page)
})
@@ -71,7 +70,7 @@ test('Next zoom is 500m', async () => {
const { imageResolution } = selectors
await zoomIn(page)
await openImageDownloadPanel(page)
- await expect(imageResolution).toHaveValue('2')
+ await expect(imageResolution).toHaveValue('500')
await closeImageDownloadPanel(page)
})
@@ -79,11 +78,11 @@ test('Next two zooms are 250m', async () => {
const { imageResolution } = selectors
await zoomIn(page)
await openImageDownloadPanel(page)
- await expect(imageResolution).toHaveValue('1')
+ await expect(imageResolution).toHaveValue('250')
await closeImageDownloadPanel(page)
await zoomIn(page)
await openImageDownloadPanel(page)
- await expect(imageResolution).toHaveValue('1')
+ await expect(imageResolution).toHaveValue('250')
await closeImageDownloadPanel(page)
})
@@ -91,7 +90,7 @@ test('Next zoom is 125m', async () => {
const { imageResolution } = selectors
await zoomIn(page)
await openImageDownloadPanel(page)
- await expect(imageResolution).toHaveValue('0.5')
+ await expect(imageResolution).toHaveValue('125')
await closeImageDownloadPanel(page)
})
@@ -99,7 +98,7 @@ test('Next zoom is 60m', async () => {
const { imageResolution } = selectors
await zoomIn(page)
await openImageDownloadPanel(page)
- await expect(imageResolution).toHaveValue('0.25')
+ await expect(imageResolution).toHaveValue('60')
await closeImageDownloadPanel(page)
})
@@ -107,7 +106,7 @@ test('Next zoom is 30m', async () => {
const { imageResolution } = selectors
await zoomIn(page)
await openImageDownloadPanel(page)
- await expect(imageResolution).toHaveValue('0.125')
+ await expect(imageResolution).toHaveValue('30')
await closeImageDownloadPanel(page)
})
@@ -115,28 +114,37 @@ test('Last zoom level is 30m', async () => {
const { imageResolution } = selectors
await zoomIn(page)
await openImageDownloadPanel(page)
- await expect(imageResolution).toHaveValue('0.125')
+ await expect(imageResolution).toHaveValue('30')
await closeImageDownloadPanel(page)
})
-test('Confirm bounding box integrity', async () => {
+test('Confirm bounding box integrity by testing snapshot functionality', async () => {
await openImageDownloadPanel(page)
+
+ const downloadPromise = page.waitForEvent('download')
+
+ // Verify the bounding box display is present
+ const bboxDisplay = page.locator('.wv-image-input-case')
+ await expect(bboxDisplay).toBeVisible()
+
+ // Start download and verify progress indicator appears
await clickDownload(page)
- const urlAttribute = await getAttribute(page, '#wv-image-download-url', 'url')
- const matcher = /BBOX=([^,]+),([^,]+),([^,]+),([^&]+)/
- const matches = matcher.exec(urlAttribute)
- if (matches !== null) {
- const x0 = Number.parseFloat(matches[1])
- const y0 = Number.parseFloat(matches[2])
- const x1 = Number.parseFloat(matches[3])
- const y1 = Number.parseFloat(matches[4])
- expect(x0).toBeLessThan(0)
- expect(x0).toBeGreaterThan(-20000)
- expect(y0).toBeLessThan(0)
- expect(y0).toBeGreaterThan(-20000)
- expect(x1).toBeGreaterThan(0)
- expect(x1).toBeLessThan(20000)
- expect(y1).toBeGreaterThan(0)
- expect(y1).toBeLessThan(20000)
+ const progressDialog = page.locator('.wv-snapshot-progress-overlay')
+ await expect(progressDialog).toBeVisible()
+
+ const cancelButton = page.locator('#wv-snapshot-cancel-button')
+ await expect(cancelButton).toBeVisible()
+
+ // Wait for either the download to start or the progress dialog to disappear (timeout after 20s)
+ try {
+ await Promise.race([
+ downloadPromise,
+ progressDialog.waitFor({ state: 'detached', timeout: 200_000 }),
+ cancelButton.click()
+ ])
+ } catch (e) {
+ throw new Error('Snapshot download did not complete or progress dialog did not disappear in time')
}
+
+ await closeImageDownloadPanel(page)
})
diff --git a/e2e/features/image-download/time-test.spec.js b/e2e/features/image-download/time-test.spec.js
index aaee630db..4051284ca 100644
--- a/e2e/features/image-download/time-test.spec.js
+++ b/e2e/features/image-download/time-test.spec.js
@@ -6,18 +6,22 @@ const {
clickDownload,
closeModal
} = require('../../test-utils/hooks/wvHooks')
-const { joinUrl, getAttribute } = require('../../test-utils/hooks/basicHooks')
+const { joinUrl } = require('../../test-utils/hooks/basicHooks')
/** @type {import('@playwright/test').Page} */
let page
+/** @type {Promise<import("playwright-core").Download>} */
+let downloadPromise
+
const startParams = [
- 'imageDownload='
+ 'v=-1,-1,1,1'
]
test.describe.configure({ mode: 'serial' })
test.beforeAll(async ({ browser }) => {
page = await browser.newPage()
+ downloadPromise = page.waitForEvent('download')
})
test.afterAll(async () => {
@@ -25,34 +29,97 @@ test.afterAll(async () => {
})
test('Image for today', async () => {
- const url = await joinUrl(startParams, '&now=2018-06-01T3')
+ const url = await joinUrl(startParams, null)
await page.goto(url)
await closeModal(page)
await openImageDownloadPanel(page)
+
+ // Verify current date is selected
+ const dateDisplay = page.locator('.wv-date-selector-widget')
+ await expect(dateDisplay).toBeVisible()
+
+ // Start download and verify progress indicator appears
await clickDownload(page)
- const urlAttribute = await getAttribute(page, '#wv-image-download-url', 'url')
- expect(urlAttribute).toContain('TIME=2018-06-01')
+ const progressDialog = page.locator('.wv-snapshot-progress-overlay')
+ await expect(progressDialog).toBeVisible()
+
+ const cancelButton = page.locator('#wv-snapshot-cancel-button')
+ await expect(cancelButton).toBeVisible()
+
+ // Wait for either the download to start or the progress dialog to disappear (timeout after 20s)
+ try {
+ await Promise.race([
+ downloadPromise,
+ progressDialog.waitFor({ state: 'detached', timeout: 200_000 }),
+ cancelButton.click()
+ ])
+ } catch (e) {
+ throw new Error('Snapshot download did not complete or progress dialog did not disappear in time')
+ }
+
await closeImageDownloadPanel(page)
})
-test('Image for yesterday', async () => {
- const url = await joinUrl(startParams, '&now=2018-06-01T0')
+test('Image for past date', async () => {
+ const url = await joinUrl(startParams, 't=2018-05-31')
await page.goto(url)
await closeModal(page)
await openImageDownloadPanel(page)
+
+ // Verify test date is selected
+ const dateDisplay = page.locator('.wv-date-selector-widget')
+ await expect(dateDisplay).toBeVisible()
+
+ // Start download and verify progress indicator appears
await clickDownload(page)
- const urlAttribute = await getAttribute(page, '#wv-image-download-url', 'url')
- expect(urlAttribute).toContain('TIME=2018-05-31')
+ const progressDialog = page.locator('.wv-snapshot-progress-overlay')
+ await expect(progressDialog).toBeVisible()
+
+ const cancelButton = page.locator('#wv-snapshot-cancel-button')
+ await expect(cancelButton).toBeVisible()
+
+ // Wait for either the download to start or the progress dialog to disappear (timeout after 20s)
+ try {
+ await Promise.race([
+ downloadPromise,
+ progressDialog.waitFor({ state: 'detached', timeout: 200_000 }),
+ cancelButton.click()
+ ])
+ } catch (e) {
+ throw new Error('Snapshot download did not complete or progress dialog did not disappear in time')
+ }
+
await closeImageDownloadPanel(page)
})
test('Image for 2018-05-15', async () => {
- const url = await joinUrl(startParams, '&t=2018-05-15')
+ const url = await joinUrl(startParams, 't=2018-05-15')
await page.goto(url)
await closeModal(page)
await openImageDownloadPanel(page)
+
+ // Verify specific date is selected
+ const dateDisplay = page.locator('.wv-date-selector-widget')
+ await expect(dateDisplay).toBeVisible()
+
+ // Start download and verify progress indicator appears
await clickDownload(page)
- const urlAttribute = await getAttribute(page, '#wv-image-download-url', 'url')
- expect(urlAttribute).toContain('TIME=2018-05-15')
+ const progressDialog = page.locator('.wv-snapshot-progress-overlay')
+ await expect(progressDialog).toBeVisible()
+
+ const cancelButton = page.locator('#wv-snapshot-cancel-button')
+ await expect(cancelButton).toBeVisible()
+
+ // Wait for either the download to start or the progress dialog to disappear (timeout after 20s)
+ try {
+ await Promise.race([
+ downloadPromise,
+ progressDialog.waitFor({ state: 'detached', timeout: 200_000 }),
+ cancelButton.click()
+ ])
+ } catch (e) {
+ throw new Error('Snapshot download did not complete or progress dialog did not disappear in time')
+ }
+
await closeImageDownloadPanel(page)
})
diff --git a/e2e/features/image-download/unsupported-test.spec.js b/e2e/features/image-download/unsupported-test.spec.js
index f3be29f79..c9c37bce1 100644
--- a/e2e/features/image-download/unsupported-test.spec.js
+++ b/e2e/features/image-download/unsupported-test.spec.js
@@ -1,7 +1,7 @@
// @ts-check
const { test, expect } = require('@playwright/test')
const createSelectors = require('../../test-utils/global-variables/selectors')
-const { closeImageDownloadPanel, closeModal } = require('../../test-utils/hooks/wvHooks')
+const { closeModal } = require('../../test-utils/hooks/wvHooks')
const { joinUrl } = require('../../test-utils/hooks/basicHooks')
/** @type {import('@playwright/test').Page} */
@@ -13,7 +13,7 @@ let cancelNotify
let acceptNotify
let toolbarSnapshot
-const startParams = ['v=-180,-90,180,90', 't=2018-06-01', 'imageDownload=']
+const startParams = ['v=-180,-90,180,90', 't=2018-06-01']
test.describe.configure({ mode: 'serial' })
@@ -30,31 +30,6 @@ test.afterAll(async () => {
await page.close()
})
-test('Custom palettes are not supported dialog', async () => {
- const { snapshotToolbarButton } = selectors
- const url = await joinUrl(startParams, '&l=MODIS_Terra_Aerosol(palette=red_1)')
- await page.goto(url)
- await closeModal(page)
- await snapshotToolbarButton.click()
- await expect(notify).toBeVisible()
-})
-
-test('Custom palettes: Cancel button', async () => {
- await cancelNotify.click()
- await expect(notify).not.toBeVisible()
- await expect(toolbarSnapshot).not.toBeVisible()
-})
-
-test('Custom palettes: OK button brings up download panel', async () => {
- const { snapshotToolbarButton } = selectors
- await snapshotToolbarButton.click()
- await expect(notify).toBeVisible()
- await acceptNotify.click()
- await expect(notify).not.toBeVisible()
- await expect(toolbarSnapshot).toBeVisible()
- await closeImageDownloadPanel(page)
-})
-
test('Rotation is not supported dialog', async () => {
const { snapshotToolbarButton } = selectors
const url = await joinUrl(startParams, '&p=arctic&r=18')
diff --git a/package-lock.json b/package-lock.json
index c6bd2c390..375f5186c 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -27,6 +27,7 @@
"bluebird": "3.7.2",
"bootstrap": "^5.3.8",
"cachai": "^1.0.2",
+ "canvas-size": "^2.0.0",
"compression": "^1.8.1",
"coordinate-parser": "^1.0.7",
"copy-to-clipboard": "^4.0.2",
@@ -35,13 +36,17 @@
"elm-pep": "^1.0.6",
"eslint-plugin-react-hooks": "^7.1.1",
"file-saver": "^2.0.5",
+ "gdal3.js": "^2.8.1",
"geographiclib-geodesic": "^2.2.0",
"history": "^5.3.0",
+ "html2canvas": "^1.4.1",
"imagesloaded": "^5.0.0",
"immutability-helper": "^3.1.1",
"jsdom-worker": "^0.3.0",
+ "jszip": "^3.10.1",
"lodash": "^4.18.1",
"masonry-layout": "^4.2.2",
+ "mathjs": "^15.2.0",
"moment": "^2.30.1",
"moment-locales-webpack-plugin": "^1.2.0",
"node-dir": "^0.1.17",
@@ -92,6 +97,7 @@
"babel-loader": "^10.1.1",
"cheerio": "^1.2.0",
"clean-webpack-plugin": "^4.0.0",
+ "copy-webpack-plugin": "^14.0.0",
"cross-env": "^10.1.0",
"css-loader": "^7.1.4",
"css-minimizer-webpack-plugin": "^8.0.0",
@@ -2370,40 +2376,6 @@
"value-equal": "^1.0.1"
}
},
- "node_modules/@emnapi/core": {
- "version": "1.10.0",
- "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.10.0.tgz",
- "integrity": "sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw==",
- "dev": true,
- "license": "MIT",
- "optional": true,
- "dependencies": {
- "@emnapi/wasi-threads": "1.2.1",
- "tslib": "^2.4.0"
- }
- },
- "node_modules/@emnapi/runtime": {
- "version": "1.10.0",
- "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.10.0.tgz",
- "integrity": "sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==",
- "dev": true,
- "license": "MIT",
- "optional": true,
- "dependencies": {
- "tslib": "^2.4.0"
- }
- },
- "node_modules/@emnapi/wasi-threads": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.1.tgz",
- "integrity": "sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==",
- "dev": true,
- "license": "MIT",
- "optional": true,
- "dependencies": {
- "tslib": "^2.4.0"
- }
- },
"node_modules/@emotion/babel-plugin": {
"version": "11.13.5",
"license": "MIT",
@@ -5694,6 +5666,40 @@
"node": ">=14.0.0"
}
},
+ "node_modules/@unrs/resolver-binding-wasm32-wasi/node_modules/@emnapi/core": {
+ "version": "1.10.0",
+ "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.10.0.tgz",
+ "integrity": "sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw==",
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "@emnapi/wasi-threads": "1.2.1",
+ "tslib": "^2.4.0"
+ }
+ },
+ "node_modules/@unrs/resolver-binding-wasm32-wasi/node_modules/@emnapi/runtime": {
+ "version": "1.10.0",
+ "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.10.0.tgz",
+ "integrity": "sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==",
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "tslib": "^2.4.0"
+ }
+ },
+ "node_modules/@unrs/resolver-binding-wasm32-wasi/node_modules/@emnapi/wasi-threads": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.1.tgz",
+ "integrity": "sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==",
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "tslib": "^2.4.0"
+ }
+ },
"node_modules/@unrs/resolver-binding-win32-arm64-msvc": {
"version": "1.12.2",
"resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-arm64-msvc/-/resolver-binding-win32-arm64-msvc-1.12.2.tgz",
@@ -6564,6 +6570,15 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/base64-arraybuffer": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz",
+ "integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6.0"
+ }
+ },
"node_modules/baseline-browser-mapping": {
"version": "2.10.44",
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.44.tgz",
@@ -6911,6 +6926,12 @@
],
"license": "CC-BY-4.0"
},
+ "node_modules/canvas-size": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/canvas-size/-/canvas-size-2.0.0.tgz",
+ "integrity": "sha512-D7yvTTPX5ZvmocInOaRXyAsLtvjy7nctyfA+SNOlTG0KPjsmhw/eoJJkx8risaY/VSUW04vd8UPN7j3Ge634OQ==",
+ "license": "MIT"
+ },
"node_modules/chalk": {
"version": "4.1.2",
"dev": true,
@@ -7189,6 +7210,19 @@
"node": "^12.20.0 || >=14"
}
},
+ "node_modules/complex.js": {
+ "version": "2.4.3",
+ "resolved": "https://registry.npmjs.org/complex.js/-/complex.js-2.4.3.tgz",
+ "integrity": "sha512-UrQVSUur14tNX6tiP4y8T4w4FeJAX3bi2cIv0pu/DTLFNxoq7z2Yh83Vfzztj6Px3X/lubqQ9IrPp7Bpn6p4MQ==",
+ "license": "MIT",
+ "engines": {
+ "node": "*"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/rawify"
+ }
+ },
"node_modules/compressible": {
"version": "2.0.18",
"license": "MIT",
@@ -7291,6 +7325,30 @@
"version": "4.0.2",
"license": "MIT"
},
+ "node_modules/copy-webpack-plugin": {
+ "version": "14.0.0",
+ "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-14.0.0.tgz",
+ "integrity": "sha512-3JLW90aBGeaTLpM7mYQKpnVdgsUZRExY55giiZgLuX/xTQRUs1dOCwbBnWnvY6Q6rfZoXMNwzOQJCSZPppfqXA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "glob-parent": "^6.0.1",
+ "normalize-path": "^3.0.0",
+ "schema-utils": "^4.2.0",
+ "serialize-javascript": "^7.0.3",
+ "tinyglobby": "^0.2.12"
+ },
+ "engines": {
+ "node": ">= 20.9.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/webpack"
+ },
+ "peerDependencies": {
+ "webpack": "^5.1.0"
+ }
+ },
"node_modules/core-js-compat": {
"version": "3.49.0",
"dev": true,
@@ -7315,7 +7373,6 @@
},
"node_modules/core-util-is": {
"version": "1.0.3",
- "dev": true,
"license": "MIT"
},
"node_modules/cosmiconfig": {
@@ -7412,6 +7469,15 @@
"node": ">=12"
}
},
+ "node_modules/css-line-break": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/css-line-break/-/css-line-break-2.1.0.tgz",
+ "integrity": "sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==",
+ "license": "MIT",
+ "dependencies": {
+ "utrie": "^1.0.2"
+ }
+ },
"node_modules/css-loader": {
"version": "7.1.4",
"dev": true,
@@ -8330,7 +8396,6 @@
},
"node_modules/decimal.js": {
"version": "10.6.0",
- "dev": true,
"license": "MIT"
},
"node_modules/decimal.js-light": {
@@ -8523,7 +8588,6 @@
},
"node_modules/detect-node": {
"version": "2.1.0",
- "dev": true,
"license": "MIT"
},
"node_modules/dns-packet": {
@@ -8974,6 +9038,12 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/escape-latex": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/escape-latex/-/escape-latex-1.2.0.tgz",
+ "integrity": "sha512-nV5aVWW1K0wEiUIEdZ4erkGGH8mDxGyxSeqPzRNtWP7ataw+/olFObw7hujFWlVjNsaDFw5VZ5NzVSIqRgfTiw==",
+ "license": "MIT"
+ },
"node_modules/escape-string-regexp": {
"version": "4.0.0",
"license": "MIT",
@@ -10093,7 +10163,6 @@
},
"node_modules/fraction.js": {
"version": "5.3.4",
- "dev": true,
"license": "MIT",
"engines": {
"node": "*"
@@ -10164,6 +10233,16 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/gdal3.js": {
+ "version": "2.8.1",
+ "resolved": "https://registry.npmjs.org/gdal3.js/-/gdal3.js-2.8.1.tgz",
+ "integrity": "sha512-Zg3T0vyDAPJ7kyyhyjhmG2OvUg7Xpn+Uh9+hTMIKXj4JDrJPERTrA8Q9wpthtqX9yvaftg7aS9YIrot4p7cNLA==",
+ "license": "LGPL-2.1-or-later",
+ "dependencies": {
+ "detect-node": "^2.1.0",
+ "xml-js": "^1.6.11"
+ }
+ },
"node_modules/generator-function": {
"version": "2.0.1",
"dev": true,
@@ -10734,6 +10813,19 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/html2canvas": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/html2canvas/-/html2canvas-1.4.1.tgz",
+ "integrity": "sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==",
+ "license": "MIT",
+ "dependencies": {
+ "css-line-break": "^2.1.0",
+ "text-segmentation": "^1.0.3"
+ },
+ "engines": {
+ "node": ">=8.0.0"
+ }
+ },
"node_modules/htmlparser2": {
"version": "10.1.0",
"dev": true,
@@ -10942,6 +11034,12 @@
"ev-emitter": "^2.1.2"
}
},
+ "node_modules/immediate": {
+ "version": "3.0.6",
+ "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz",
+ "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==",
+ "license": "MIT"
+ },
"node_modules/immer": {
"version": "11.1.8",
"license": "MIT",
@@ -11034,7 +11132,6 @@
},
"node_modules/inherits": {
"version": "2.0.4",
- "dev": true,
"license": "ISC"
},
"node_modules/ini": {
@@ -11715,6 +11812,12 @@
"@pkgjs/parseargs": "^0.11.0"
}
},
+ "node_modules/javascript-natural-sort": {
+ "version": "0.7.1",
+ "resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz",
+ "integrity": "sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw==",
+ "license": "MIT"
+ },
"node_modules/jest": {
"version": "30.4.2",
"dev": true,
@@ -12874,6 +12977,60 @@
"node": ">=4.0"
}
},
+ "node_modules/jszip": {
+ "version": "3.10.1",
+ "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz",
+ "integrity": "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==",
+ "license": "(MIT OR GPL-3.0-or-later)",
+ "dependencies": {
+ "lie": "~3.3.0",
+ "pako": "~1.0.2",
+ "readable-stream": "~2.3.6",
+ "setimmediate": "^1.0.5"
+ }
+ },
+ "node_modules/jszip/node_modules/isarray": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
+ "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==",
+ "license": "MIT"
+ },
+ "node_modules/jszip/node_modules/pako": {
+ "version": "1.0.11",
+ "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
+ "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==",
+ "license": "(MIT AND Zlib)"
+ },
+ "node_modules/jszip/node_modules/readable-stream": {
+ "version": "2.3.8",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",
+ "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",
+ "license": "MIT",
+ "dependencies": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.3",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~2.0.0",
+ "safe-buffer": "~5.1.1",
+ "string_decoder": "~1.1.1",
+ "util-deprecate": "~1.0.1"
+ }
+ },
+ "node_modules/jszip/node_modules/safe-buffer": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
+ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
+ "license": "MIT"
+ },
+ "node_modules/jszip/node_modules/string_decoder": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+ "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+ "license": "MIT",
+ "dependencies": {
+ "safe-buffer": "~5.1.0"
+ }
+ },
"node_modules/kdbush": {
"version": "4.1.0",
"license": "ISC"
@@ -12948,6 +13105,15 @@
"node": ">= 0.8.0"
}
},
+ "node_modules/lie": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz",
+ "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==",
+ "license": "MIT",
+ "dependencies": {
+ "immediate": "~3.0.5"
+ }
+ },
"node_modules/lilconfig": {
"version": "3.1.3",
"dev": true,
@@ -13163,6 +13329,29 @@
"node": ">= 0.4"
}
},
+ "node_modules/mathjs": {
+ "version": "15.2.0",
+ "resolved": "https://registry.npmjs.org/mathjs/-/mathjs-15.2.0.tgz",
+ "integrity": "sha512-UAQzSVob9rNLdGpqcFMYmSu9dkuLYy7Lr2hBEQS5SHQdknA9VppJz3cy2KkpMzTODunad6V6cNv+5kOLsePLow==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@babel/runtime": "^7.26.10",
+ "complex.js": "^2.2.5",
+ "decimal.js": "^10.4.3",
+ "escape-latex": "^1.2.0",
+ "fraction.js": "^5.2.1",
+ "javascript-natural-sort": "^0.7.1",
+ "seedrandom": "^3.0.5",
+ "tiny-emitter": "^2.1.0",
+ "typed-function": "^4.2.1"
+ },
+ "bin": {
+ "mathjs": "bin/cli.js"
+ },
+ "engines": {
+ "node": ">= 18"
+ }
+ },
"node_modules/mathml-tag-names": {
"version": "4.0.0",
"dev": true,
@@ -15478,7 +15667,6 @@
},
"node_modules/process-nextick-args": {
"version": "2.0.1",
- "dev": true,
"license": "MIT"
},
"node_modules/proj4": {
@@ -16489,7 +16677,6 @@
},
"node_modules/sax": {
"version": "1.6.0",
- "dev": true,
"license": "BlueOak-1.0.0",
"engines": {
"node": ">=11.0.0"
@@ -16555,6 +16742,12 @@
"version": "2.1.0",
"license": "ISC"
},
+ "node_modules/seedrandom": {
+ "version": "3.0.5",
+ "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz",
+ "integrity": "sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg==",
+ "license": "MIT"
+ },
"node_modules/select-hose": {
"version": "2.0.0",
"dev": true,
@@ -16778,6 +16971,12 @@
"node": ">= 0.4"
}
},
+ "node_modules/setimmediate": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
+ "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==",
+ "license": "MIT"
+ },
"node_modules/setprototypeof": {
"version": "1.2.0",
"dev": true,
@@ -18131,6 +18330,15 @@
"url": "https://github.com/sponsors/isaacs"
}
},
+ "node_modules/text-segmentation": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/text-segmentation/-/text-segmentation-1.0.3.tgz",
+ "integrity": "sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==",
+ "license": "MIT",
+ "dependencies": {
+ "utrie": "^1.0.2"
+ }
+ },
"node_modules/thingies": {
"version": "2.6.0",
"dev": true,
@@ -18151,6 +18359,12 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/tiny-emitter": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz",
+ "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==",
+ "license": "MIT"
+ },
"node_modules/tiny-invariant": {
"version": "1.3.3",
"license": "MIT"
@@ -18476,6 +18690,15 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/typed-function": {
+ "version": "4.2.2",
+ "resolved": "https://registry.npmjs.org/typed-function/-/typed-function-4.2.2.tgz",
+ "integrity": "sha512-VwaXim9Gp1bngi/q3do8hgttYn2uC3MoT/gfuMWylnj1IeZBUAyPddHZlo1K05BDoj8DYPpMdiHqH1dDYdJf2A==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 18"
+ }
+ },
"node_modules/typescript-eslint": {
"version": "8.61.1",
"dev": true,
@@ -18725,7 +18948,6 @@
},
"node_modules/util-deprecate": {
"version": "1.0.2",
- "dev": true,
"license": "MIT"
},
"node_modules/utils-merge": {
@@ -18736,6 +18958,15 @@
"node": ">= 0.4.0"
}
},
+ "node_modules/utrie": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/utrie/-/utrie-1.0.2.tgz",
+ "integrity": "sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==",
+ "license": "MIT",
+ "dependencies": {
+ "base64-arraybuffer": "^1.0.2"
+ }
+ },
"node_modules/uuid": {
"version": "14.0.1",
"dev": true,
@@ -19897,7 +20128,6 @@
},
"node_modules/xml-js": {
"version": "1.6.11",
- "dev": true,
"license": "MIT",
"dependencies": {
"sax": "^1.2.4"
diff --git a/package.json b/package.json
index df45da4db..5118d7c75 100644
--- a/package.json
+++ b/package.json
@@ -101,6 +101,7 @@
"babel-loader": "^10.1.1",
"cheerio": "^1.2.0",
"clean-webpack-plugin": "^4.0.0",
+ "copy-webpack-plugin": "^14.0.0",
"cross-env": "^10.1.0",
"css-loader": "^7.1.4",
"css-minimizer-webpack-plugin": "^8.0.0",
@@ -174,6 +175,7 @@
"bluebird": "3.7.2",
"bootstrap": "^5.3.8",
"cachai": "^1.0.2",
+ "canvas-size": "^2.0.0",
"compression": "^1.8.1",
"coordinate-parser": "^1.0.7",
"copy-to-clipboard": "^4.0.2",
@@ -182,13 +184,17 @@
"elm-pep": "^1.0.6",
"eslint-plugin-react-hooks": "^7.1.1",
"file-saver": "^2.0.5",
+ "gdal3.js": "^2.8.1",
"geographiclib-geodesic": "^2.2.0",
"history": "^5.3.0",
+ "html2canvas": "^1.4.1",
"imagesloaded": "^5.0.0",
"immutability-helper": "^3.1.1",
"jsdom-worker": "^0.3.0",
+ "jszip": "^3.10.1",
"lodash": "^4.18.1",
"masonry-layout": "^4.2.2",
+ "mathjs": "^15.2.0",
"moment": "^2.30.1",
"moment-locales-webpack-plugin": "^1.2.0",
"node-dir": "^0.1.17",
diff --git a/schemas/layer-config.json b/schemas/layer-config.json
index 459428785..89a8bd19e 100644
--- a/schemas/layer-config.json
+++ b/schemas/layer-config.json
@@ -41,6 +41,9 @@
"disableSnapshot": {
"type": "boolean"
},
+ "disableGIF": {
+ "type": "boolean"
+ },
"sourceOverride": {
"type": "string"
},
diff --git a/web/css/components/image-download/snapshot-progress.css b/web/css/components/image-download/snapshot-progress.css
new file mode 100644
index 000000000..563f31e8a
--- /dev/null
+++ b/web/css/components/image-download/snapshot-progress.css
@@ -0,0 +1,72 @@
+/* Snapshot progress styles */
+.wv-snapshot-progress {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 10px;
+ margin: 10px 0;
+ background-color: #222;
+ color: white;
+ border: none;
+ flex-direction: column;
+ border-radius: 6px;
+ opacity: 1;
+}
+
+.wv-snapshot-progress-message {
+ display: flex;
+ align-items: center;
+ font-weight: 500;
+ color: white;
+}
+
+.wv-snapshot-progress-message::before {
+ content: '';
+ display: inline-block;
+ width: 16px;
+ height: 16px;
+ margin-right: 10px;
+ border: 2px solid white;
+ border-top: 2px solid transparent;
+ border-radius: 50%;
+ animation: wv-snapshot-spin 1s linear infinite;
+}
+
+.wv-snapshot-progress-actions {
+ flex-shrink: 0;
+ padding: 1rem;
+}
+
+@keyframes wv-snapshot-spin {
+ 0% { transform: rotate(0deg); }
+ 100% { transform: rotate(360deg); }
+}
+
+.wv-snapshot-progress-dialog {
+ position: absolute;
+ background-color: #222;
+ color: white;
+ left: 0;
+ top: 40%;
+ z-index: 9999999999;
+ box-sizing: unset;
+ opacity: 1;
+ border: 1px solid #555;
+ border-radius: 6px;
+
+ button {
+ cursor: pointer;
+ }
+}
+
+.wv-snapshot-progress-overlay {
+ position: absolute;
+ top: 0;
+ left: 0;
+ background-color: rgba(0, 0, 0, 0.95);
+ opacity: 1;
+ cursor: wait;
+ width: 100%;
+ height: 100%;
+ z-index: 2;
+}
diff --git a/web/images/natural-events/dot.svg b/web/images/natural-events/dot.svg
index 4d0b64441..9507b5ba0 100644
--- a/web/images/natural-events/dot.svg
+++ b/web/images/natural-events/dot.svg
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
-<svg viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg">
+<svg viewBox="0 0 30 30" width="26" height="26" xmlns="http://www.w3.org/2000/svg">
<circle cx="15" cy="15.25" r="14" style="fill: rgb(255, 255, 255); stroke: rgb(0, 0, 0); stroke-width: 0.25;"/>
</svg>
diff --git a/web/images/natural-events/icon-critical.svg b/web/images/natural-events/icon-critical.svg
index 582f8b6cd..83ac7654c 100644
--- a/web/images/natural-events/icon-critical.svg
+++ b/web/images/natural-events/icon-critical.svg
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<svg viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg">
+<svg viewBox="0 0 30 30" width="26" height="26" xmlns="http://www.w3.org/2000/svg">
<circle cx="15" cy="15.25" r="13" style="fill:#585858;" />
<path fill="#FFFFFF" d="M 15 20.465 C 16.076 20.465 16.95 21.339 16.95 22.415 C 16.95 23.491 16.076 24.365 15 24.365 C 13.924 24.365 13.05 23.491 13.05 22.415 C 13.05 21.339 13.924 20.465 15 20.465 Z M 15.78 18.775 C 15.78 18.775 16.95 12.34 16.95 9.025 C 16.95 7.949 16.076 7.075 15 7.075 C 13.924 7.075 13.05 7.949 13.05 9.025 C 13.05 11.728 14.22 18.775 14.22 18.775 C 14.22 18.775 14.581 18.671 15 18.671 C 15.419 18.671 15.78 18.775 15.78 18.775 Z"/>
</svg>
diff --git a/web/images/natural-events/icon-default.svg b/web/images/natural-events/icon-default.svg
index 66a4721fd..6ebc11e2d 100644
--- a/web/images/natural-events/icon-default.svg
+++ b/web/images/natural-events/icon-default.svg
@@ -1,3 +1,3 @@
-<svg aria-hidden="true" data-prefix="fas" data-icon="globe-americas" class="svg-inline--fa fa-globe-americas fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512">
+<svg aria-hidden="true" data-prefix="fas" data-icon="globe-americas" class="svg-inline--fa fa-globe-americas fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512" width="26" height="26">
<path fill="#00457b" d="M248 8C111.03 8 0 119.03 0 256s111.03 248 248 248 248-111.03 248-248S384.97 8 248 8zm82.29 357.6c-3.9 3.88-7.99 7.95-11.31 11.28-2.99 3-5.1 6.7-6.17 10.71-1.51 5.66-2.73 11.38-4.77 16.87l-17.39 46.85c-13.76 3-28 4.69-42.65 4.69v-27.38c1.69-12.62-7.64-36.26-22.63-51.25-6-6-9.37-14.14-9.37-22.63v-32.01c0-11.64-6.27-22.34-16.46-27.97-14.37-7.95-34.81-19.06-48.81-26.11-11.48-5.78-22.1-13.14-31.65-21.75l-.8-.72a114.792 114.792 0 0 1-18.06-20.74c-9.38-13.77-24.66-36.42-34.59-51.14 20.47-45.5 57.36-82.04 103.2-101.89l24.01 12.01C203.48 89.74 216 82.01 216 70.11v-11.3c7.99-1.29 16.12-2.11 24.39-2.42l28.3 28.3c6.25 6.25 6.25 16.38 0 22.63L264 112l-10.34 10.34c-3.12 3.12-3.12 8.19 0 11.31l4.69 4.69c3.12 3.12 3.12 8.19 0 11.31l-8 8a8.008 8.008 0 0 1-5.66 2.34h-8.99c-2.08 0-4.08.81-5.58 2.27l-9.92 9.65a8.008 8.008 0 0 0-1.58 9.31l15.59 31.19c2.66 5.32-1.21 11.58-7.15 11.58h-5.64c-1.93 0-3.79-.7-5.24-1.96l-9.28-8.06a16.017 16.017 0 0 0-15.55-3.1l-31.17 10.39a11.95 11.95 0 0 0-8.17 11.34c0 4.53 2.56 8.66 6.61 10.69l11.08 5.54c9.41 4.71 19.79 7.16 30.31 7.16s22.59 27.29 32 32h66.75c8.49 0 16.62 3.37 22.63 9.37l13.69 13.69a30.503 30.503 0 0 1 8.93 21.57 46.536 46.536 0 0 1-13.72 32.98zM417 274.25c-5.79-1.45-10.84-5-14.15-9.97l-17.98-26.97a23.97 23.97 0 0 1 0-26.62l19.59-29.38c2.32-3.47 5.5-6.29 9.24-8.15l12.98-6.49C440.2 193.59 448 223.87 448 256c0 8.67-.74 17.16-1.82 25.54L417 274.25z"></path>
</svg>
\ No newline at end of file
diff --git a/web/images/natural-events/icon-dust-and-haze.svg b/web/images/natural-events/icon-dust-and-haze.svg
index 4f9372cc5..17d3c3626 100644
--- a/web/images/natural-events/icon-dust-and-haze.svg
+++ b/web/images/natural-events/icon-dust-and-haze.svg
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<svg viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg">
+<svg viewBox="0 0 30 30" width="26" height="26" xmlns="http://www.w3.org/2000/svg">
<circle cx="15" cy="15.25" r="13" style="fill:#a09758;" />
<path fill="#FFFFFF" d="M 25.387 19.933 C 23.578 23.882 19.589 26.629 14.964 26.629 C 10.34 26.629 6.35 23.882 4.542 19.933 L 25.387 19.933 Z M 16.195 19.049 C 11.75 19.053 6.904 19.06 6.904 19.06 C 11.995 18.354 11.425 15.646 15.08 17.179 C 13.511 15.543 16.769 13.02 19.047 14.701 C 18.69 14.077 17.611 13.686 16.669 13.97 C 15.949 12.812 17.864 10.749 19.774 11.654 C 23.179 10.609 24.622 13.446 24.521 14.282 C 26.576 15.326 25.001 19.085 23.407 19.053 C 23.102 19.046 20.477 19.046 17.407 19.048 C 17.337 19.057 17.267 19.061 17.197 19.06 C 17.052 19.056 16.699 19.053 16.195 19.049 L 16.195 19.049 Z M 6.93 17.501 C 4.82 15.278 9.241 11.876 12.321 14.16 C 11.839 13.315 10.378 12.78 9.101 13.162 C 8.128 11.589 11.403 9.402 13.319 10.799 C 14.563 9.091 17.571 9.355 18.228 10.865 C 17.157 10.726 15.315 11.914 15.804 13.869 C 14.975 14.076 13.969 14.852 14.061 16.228 C 10.992 15.295 10.904 18.648 4.5 19.005 C 6.229 18.637 6.895 17.577 6.93 17.501 L 6.93 17.501 Z M 11.005 18.214 C 11.146 18.214 11.26 18.328 11.26 18.468 C 11.26 18.609 11.146 18.723 11.005 18.723 C 10.864 18.723 10.751 18.609 10.751 18.468 C 10.751 18.328 10.864 18.214 11.005 18.214 Z M 5.011 17.985 C 5.151 17.985 5.266 18.099 5.266 18.24 C 5.266 18.38 5.151 18.494 5.011 18.494 C 4.87 18.494 4.756 18.38 4.756 18.24 C 4.756 18.099 4.87 17.985 5.011 17.985 Z M 11.693 17.679 C 11.834 17.679 11.947 17.793 11.947 17.934 C 11.947 18.074 11.834 18.189 11.693 18.189 C 11.552 18.189 11.438 18.074 11.438 17.934 C 11.438 17.793 11.552 17.679 11.693 17.679 Z M 6.131 17.222 C 6.271 17.222 6.386 17.337 6.386 17.477 C 6.386 17.618 6.271 17.731 6.131 17.731 C 5.99 17.731 5.877 17.618 5.877 17.477 C 5.877 17.337 5.99 17.222 6.131 17.222 Z M 6.93 17.501 L 6.934 17.506 C 6.932 17.499 6.932 17.498 6.93 17.501 Z M 15.838 16.594 C 15.978 16.594 16.093 16.707 16.093 16.848 C 16.093 16.989 15.978 17.103 15.838 17.103 C 15.697 17.103 15.584 16.989 15.584 16.848 C 15.584 16.707 15.697 16.594 15.838 16.594 Z M 5.571 16.56 C 5.711 16.56 5.826 16.675 5.826 16.815 C 5.826 16.956 5.711 17.069 5.571 17.069 C 5.43 17.069 5.317 16.956 5.317 16.815 C 5.317 16.675 5.43 16.56 5.571 16.56 Z M 23.291 14.567 C 24.423 14.823 25.068 16.145 24.335 17.017 C 24.749 15.782 23.492 14.317 21.743 14.804 C 22.199 14.474 22.604 14.439 22.935 14.5 C 22.718 13.405 21.477 13.379 20.624 13.715 C 21.418 12.797 23.152 13.234 23.291 14.567 L 23.291 14.567 Z M 7.235 16.381 C 7.375 16.381 7.49 16.495 7.49 16.636 C 7.49 16.776 7.375 16.889 7.235 16.889 C 7.094 16.889 6.981 16.776 6.981 16.636 C 6.981 16.495 7.094 16.381 7.235 16.381 Z M 15.494 15.75 C 15.635 15.75 15.748 15.864 15.748 16.005 C 15.748 16.145 15.635 16.259 15.494 16.259 C 15.354 16.259 15.239 16.145 15.239 16.005 C 15.239 15.864 15.354 15.75 15.494 15.75 Z M 16.246 15.288 C 16.386 15.288 16.5 15.403 16.5 15.543 C 16.5 15.684 16.386 15.797 16.246 15.797 C 16.105 15.797 15.991 15.684 15.991 15.543 C 15.991 15.403 16.105 15.288 16.246 15.288 Z M 8.052 14.567 C 8.193 14.567 8.306 14.681 8.306 14.821 C 8.306 14.962 8.193 15.076 8.052 15.076 C 7.911 15.076 7.797 14.962 7.797 14.821 C 7.797 14.681 7.911 14.567 8.052 14.567 Z M 8.739 14.038 C 8.88 14.038 8.994 14.152 8.994 14.293 C 8.994 14.433 8.88 14.548 8.739 14.548 C 8.598 14.548 8.485 14.433 8.485 14.293 C 8.485 14.152 8.598 14.038 8.739 14.038 Z M 7.619 13.282 C 7.76 13.282 7.874 13.397 7.874 13.537 C 7.874 13.678 7.76 13.791 7.619 13.791 C 7.478 13.791 7.364 13.678 7.364 13.537 C 7.364 13.397 7.478 13.282 7.619 13.282 Z M 17.396 12.907 C 17.537 12.907 17.651 13.021 17.651 13.162 C 17.651 13.302 17.537 13.417 17.396 13.417 C 17.255 13.417 17.141 13.302 17.141 13.162 C 17.141 13.021 17.255 12.907 17.396 12.907 Z M 8.357 12.786 C 8.498 12.786 8.612 12.9 8.612 13.04 C 8.612 13.181 8.498 13.295 8.357 13.295 C 8.216 13.295 8.103 13.181 8.103 13.04 C 8.103 12.9 8.216 12.786 8.357 12.786 Z M 17.999 12.231 C 18.139 12.231 18.253 12.344 18.253 12.485 C 18.253 12.625 18.139 12.74 17.999 12.74 C 17.858 12.74 17.744 12.625 17.744 12.485 C 17.744 12.344 17.858 12.231 17.999 12.231 Z M 9.732 12.154 C 9.873 12.154 9.987 12.268 9.987 12.409 C 9.987 12.549 9.873 12.664 9.732 12.664 C 9.591 12.664 9.478 12.549 9.478 12.409 C 9.478 12.268 9.591 12.154 9.732 12.154 Z M 10.853 12.154 C 10.993 12.154 11.107 12.268 11.107 12.409 C 11.107 12.549 10.993 12.664 10.853 12.664 C 10.712 12.664 10.598 12.549 10.598 12.409 C 10.598 12.268 10.712 12.154 10.853 12.154 Z M 10.292 11.442 C 10.433 11.442 10.547 11.555 10.547 11.696 C 10.547 11.836 10.433 11.951 10.292 11.951 C 10.151 11.951 10.038 11.836 10.038 11.696 C 10.038 11.555 10.151 11.442 10.292 11.442 Z"/>
</svg>
diff --git a/web/images/natural-events/icon-floods.svg b/web/images/natural-events/icon-floods.svg
index 6d153d0ff..a112c4ab2 100644
--- a/web/images/natural-events/icon-floods.svg
+++ b/web/images/natural-events/icon-floods.svg
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<svg id="Layer_2" data-name="Layer 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 26">
+<svg id="Layer_2" data-name="Layer 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 26" width="26" height="26">
<defs>
<style>
.cls-1 {
diff --git a/web/images/natural-events/icon-icebergs.svg b/web/images/natural-events/icon-icebergs.svg
index bfe683055..e4352f9f4 100644
--- a/web/images/natural-events/icon-icebergs.svg
+++ b/web/images/natural-events/icon-icebergs.svg
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<svg viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg">
+<svg viewBox="0 0 30 30" width="26" height="26" xmlns="http://www.w3.org/2000/svg">
<circle cx="15" cy="15.25" r="13" style="fill:#3889ad;" />
<path fill="#FFFFFF" d="M 21.329 14.657 C 21.386 14.669 21.444 14.676 21.5 14.676 C 21.717 14.676 21.95 14.579 22.15 14.447 C 22.367 14.304 22.8 13.875 22.8 13.875 C 22.8 13.875 23.233 14.304 23.45 14.447 C 23.65 14.579 23.883 14.676 24.1 14.676 C 24.317 14.676 24.55 14.579 24.75 14.447 C 24.967 14.304 25.4 13.875 25.4 13.875 C 25.4 13.875 25.833 14.304 26.05 14.447 C 26.247 14.577 26.476 14.673 26.689 14.676 C 26.696 14.841 26.7 15.008 26.7 15.175 C 26.7 21.632 21.457 26.875 15 26.875 C 8.543 26.875 3.3 21.632 3.3 15.175 C 3.3 15.008 3.304 14.841 3.311 14.676 C 3.524 14.673 3.753 14.577 3.95 14.447 C 4.167 14.304 4.6 13.875 4.6 13.875 C 4.6 13.875 5.033 14.304 5.25 14.447 C 5.45 14.579 5.683 14.676 5.9 14.676 C 6.117 14.676 6.35 14.579 6.55 14.447 C 6.767 14.304 7.2 13.875 7.2 13.875 C 7.2 13.875 7.633 14.304 7.85 14.447 C 8.05 14.579 8.283 14.676 8.5 14.676 C 8.58 14.676 8.663 14.663 8.745 14.639 L 10.102 18.768 L 12.677 21.05 L 13.601 23.712 L 14.558 24.108 L 14.682 23.072 L 15.378 25.674 L 17.064 24.09 L 18.03 22.07 L 20.161 19.857 L 21.329 14.657 L 21.329 14.657 Z M 9.179 14.42 C 9.371 14.351 9.8 13.875 9.8 13.875 C 9.8 13.875 10.233 14.304 10.45 14.447 C 10.65 14.579 10.883 14.676 11.1 14.676 C 11.317 14.676 11.55 14.579 11.75 14.447 C 11.967 14.304 12.4 13.875 12.4 13.875 C 12.4 13.875 12.833 14.304 13.05 14.447 C 13.25 14.579 13.483 14.676 13.7 14.676 C 13.917 14.676 14.15 14.579 14.35 14.447 C 14.567 14.304 15 13.875 15 13.875 C 15 13.875 15.433 14.304 15.65 14.447 C 15.85 14.579 16.083 14.676 16.3 14.676 C 16.517 14.676 16.75 14.579 16.95 14.447 C 17.167 14.304 17.6 13.875 17.6 13.875 C 17.6 13.875 18.033 14.304 18.25 14.447 C 18.45 14.579 18.683 14.676 18.9 14.676 C 19.117 14.676 19.35 14.579 19.55 14.447 C 19.767 14.304 20.2 13.875 20.2 13.875 C 20.2 13.875 20.667 14.417 20.902 14.473 L 19.737 19.642 L 17.666 21.739 L 16.672 23.783 L 15.62 24.79 L 14.597 21.232 L 14.22 23.488 L 13.936 23.347 L 13.035 20.746 L 10.544 18.532 L 9.179 14.42 L 9.179 14.42 Z M 8.708 14.156 L 9.3 12.285 L 11.194 11.152 L 12.337 8.784 L 15.363 9.786 L 16.716 10.917 L 18.797 11.129 L 19.571 12.17 L 21.025 12.526 L 21.318 14.156 C 20.963 14.139 20.718 13.79 20.2 13.225 C 20.2 13.225 19.481 14.156 18.9 14.156 C 18.319 14.156 17.6 13.225 17.6 13.225 C 17.6 13.225 16.818 14.156 16.3 14.156 C 15.782 14.156 15 13.225 15 13.225 C 15 13.225 14.276 14.156 13.7 14.156 C 13.124 14.156 12.4 13.225 12.4 13.225 C 12.4 13.225 11.734 14.156 11.1 14.156 C 10.466 14.156 9.8 13.225 9.8 13.225 C 9.461 13.674 9.282 13.921 8.708 14.156 L 8.708 14.156 Z"/>
</svg>
diff --git a/web/images/natural-events/icon-manmade.svg b/web/images/natural-events/icon-manmade.svg
index c44e34344..9ce6bf1bf 100644
--- a/web/images/natural-events/icon-manmade.svg
+++ b/web/images/natural-events/icon-manmade.svg
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<svg viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg">
+<svg viewBox="0 0 30 30" width="26" height="26" xmlns="http://www.w3.org/2000/svg">
<circle cx="15" cy="15.25" r="13" style="fill:#3e3e3e;" />
<path fill="#FFFFFF" d="M 5.105 21.441 C 8.024 21.213 12.333 20.918 15 20.918 C 17.667 20.918 21.976 21.213 24.895 21.441 C 22.821 24.719 19.163 26.898 15 26.898 C 10.837 26.898 7.179 24.719 5.105 21.441 L 5.105 21.441 Z M 20.821 5.048 C 22.15 5.813 23.316 6.831 24.251 8.037 L 20.514 11.883 C 20.973 15.661 18.934 16.084 17.72 18.625 C 17.558 18.963 16.764 18.408 17.418 17.037 C 17.908 16.008 19.023 15.174 18.138 14.414 C 18.006 14.3 17.331 14.09 16.099 14.698 C 14.031 15.719 12.898 17.611 12.192 18.443 C 11.764 18.948 11.177 18.547 11.501 17.619 C 11.704 17.038 13.617 14.468 15.142 13.64 C 12.74 14.319 11.135 16.522 10.728 17.105 C 10.053 18.071 9.339 17.33 9.886 16.346 C 10.31 15.584 11.242 14.092 14.154 12.431 C 11.969 13.005 10.476 14.817 10.083 15.24 C 9.271 16.113 8.765 15.288 9.413 14.416 C 9.813 13.877 10.647 12.674 12.913 11.551 C 12.099 11.674 10.739 12.298 9.715 13.47 C 9.077 14.2 8.532 13.654 9.204 12.759 C 10.747 10.705 15.067 9.475 16.776 9.178 C 17.442 9.063 19.133 7.154 20.821 5.048 L 20.821 5.048 Z"/>
</svg>
diff --git a/web/images/natural-events/icon-sea-and-lake-ice.svg b/web/images/natural-events/icon-sea-and-lake-ice.svg
index d08ca9b3b..c2ace63f4 100644
--- a/web/images/natural-events/icon-sea-and-lake-ice.svg
+++ b/web/images/natural-events/icon-sea-and-lake-ice.svg
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<svg viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg">
+<svg viewBox="0 0 30 30" width="26" height="26" xmlns="http://www.w3.org/2000/svg">
<circle cx="15" cy="15.25" r="13" style="fill:#328697;" />
<path fill="#FFFFFF" d="M 11.641 23.609 L 11.245 24.885 L 11.701 26.39 L 13.002 24.575 L 11.641 23.609 L 11.641 23.609 Z M 18.568 22.107 L 16.605 22.71 L 17.528 25.386 L 19.05 25.737 L 20.137 23.262 L 18.568 22.107 Z M 8.787 24.384 L 10.402 25.113 L 11.232 23.618 L 10.142 23.36 L 9.516 23.483 L 8.787 24.384 L 8.787 24.384 Z M 11.179 22.748 L 13.619 24.52 L 15.875 24.737 L 15.818 22.273 L 13.375 21.542 L 12.029 20.666 L 11.179 22.748 L 11.179 22.748 Z M 22.379 24.289 L 21.471 24.125 L 22.262 20.892 L 23.445 23.173 L 23.439 23.313 C 23.106 23.659 22.752 23.985 22.379 24.289 Z M 21.807 20.571 L 23.736 18.304 L 20.548 19.043 L 18.649 21.498 L 20.997 23.256 L 21.807 20.571 L 21.807 20.571 Z M 10.815 21.302 L 9.727 22.36 L 9.199 23.164 L 10.954 23.163 L 10.815 21.302 L 10.815 21.302 Z M 10.215 21.2 L 7.949 20.559 L 6.99 22.72 L 9.377 22.244 L 10.215 21.2 Z M 13.825 21.428 L 17.132 22.182 L 18.662 20.696 L 17.169 17.634 L 14.709 18.503 L 13.825 21.428 L 13.825 21.428 Z M 26.233 18.493 C 25.899 19.638 25.394 20.711 24.748 21.682 L 23.408 21.986 L 22.575 20.602 L 26.233 18.493 L 26.233 18.493 Z M 5.256 19.2 L 6.932 21.526 L 9.503 18.123 L 7.768 17.421 L 5.94 17.599 L 5.256 19.2 L 5.256 19.2 Z M 9.003 19.784 L 11.294 21.109 L 12.976 18.614 L 13.578 15.739 L 11.678 15.332 L 10.342 17.179 L 9.003 19.784 L 9.003 19.784 Z M 13.414 21.056 L 14.295 18.76 L 13.164 18.957 L 12.513 20.467 L 13.414 21.056 Z M 8.112 20.308 L 10.286 21.056 L 8.612 19.741 L 8.112 20.308 L 8.112 20.308 Z M 16.021 15.165 C 16.114 15.195 16.209 15.212 16.3 15.212 C 16.517 15.212 16.75 15.115 16.95 14.983 C 17.167 14.84 17.6 14.411 17.6 14.411 C 17.6 14.411 18.033 14.84 18.25 14.983 C 18.45 15.115 18.683 15.212 18.9 15.212 C 19.117 15.212 19.35 15.115 19.55 14.983 C 19.767 14.84 20.2 14.411 20.2 14.411 C 20.2 14.411 20.207 14.418 20.219 14.43 L 20.411 18.196 L 19.156 20.369 L 17.258 17.297 L 15.724 16.246 L 16.021 15.165 L 16.021 15.165 Z M 22.556 20.172 L 25.456 18.749 L 25.987 17.859 L 23.995 18.373 L 22.556 20.172 L 22.556 20.172 Z M 4.43 14.575 L 4.219 15.172 L 4.797 17.995 L 4.295 19.937 C 3.655 18.491 3.3 16.893 3.3 15.212 C 3.3 15.122 3.301 15.032 3.303 14.942 C 3.305 15.032 3.308 15.122 3.312 15.212 C 3.525 15.208 3.754 15.113 3.95 14.983 C 4.079 14.898 4.284 14.712 4.43 14.575 L 4.43 14.575 Z M 23.618 16.536 L 20.701 17.215 L 20.548 18.749 L 23.447 18.021 L 23.618 16.536 L 23.618 16.536 Z M 13.402 18.591 L 16.939 17.506 L 15 16.098 L 13.828 16.128 L 13.402 18.591 L 13.402 18.591 Z M 26.658 16.215 C 26.622 16.638 26.563 17.056 26.483 17.465 L 24.076 17.94 L 23.688 17.551 L 23.985 16.686 L 26.614 16.079 L 26.658 16.215 Z M 5.636 15.17 C 5.725 15.197 5.814 15.212 5.9 15.212 C 6.117 15.212 6.35 15.115 6.55 14.983 C 6.767 14.84 7.2 14.411 7.2 14.411 C 7.2 14.411 7.633 14.84 7.85 14.983 C 8.05 15.115 8.283 15.212 8.5 15.212 C 8.717 15.212 8.95 15.115 9.15 14.983 C 9.367 14.84 9.8 14.411 9.8 14.411 C 9.8 14.411 10.233 14.84 10.45 14.983 C 10.65 15.115 10.883 15.212 11.1 15.212 C 11.187 15.212 11.277 15.196 11.366 15.169 L 11.335 15.212 L 7.5 16.194 L 5.181 17.752 L 5.521 15.595 L 5.636 15.17 L 5.636 15.17 Z M 10.96 15.793 L 8.295 17.214 L 9.305 17.651 L 10.96 15.793 Z M 6.429 17.171 L 7.847 17.054 L 9.786 15.932 L 7.489 16.478 L 6.429 17.171 Z M 4.685 14.494 C 4.823 14.626 5.093 14.88 5.25 14.983 C 5.303 15.018 5.358 15.051 5.415 15.079 L 4.984 16.972 L 4.451 15.16 L 4.685 14.494 Z M 20.496 14.691 C 20.619 14.804 20.755 14.921 20.85 14.983 C 20.895 15.013 20.942 15.041 20.99 15.066 L 20.977 16.138 L 20.655 16.833 L 20.496 14.691 L 20.496 14.691 Z M 21.156 15.142 C 21.27 15.186 21.387 15.212 21.5 15.212 C 21.717 15.212 21.95 15.115 22.15 14.983 C 22.367 14.84 22.8 14.411 22.8 14.411 C 22.8 14.411 23.233 14.84 23.45 14.983 C 23.65 15.115 23.883 15.212 24.1 15.212 C 24.317 15.212 24.55 15.115 24.75 14.983 C 24.967 14.84 25.4 14.411 25.4 14.411 C 25.4 14.411 25.833 14.84 26.05 14.983 C 26.191 15.077 26.349 15.152 26.506 15.189 L 23.897 16.206 L 21.259 16.727 L 21.156 15.142 L 21.156 15.142 Z M 23.985 16.437 L 26.258 15.98 L 26.233 15.601 L 23.985 16.437 Z M 15.378 14.765 C 15.476 14.852 15.576 14.934 15.65 14.983 C 15.701 15.017 15.754 15.048 15.808 15.076 L 15.429 15.872 L 14.212 15.832 L 15.378 14.765 L 15.378 14.765 Z M 11.731 14.996 C 11.737 14.992 11.744 14.987 11.75 14.983 C 11.967 14.84 12.4 14.411 12.4 14.411 C 12.4 14.411 12.833 14.84 13.05 14.983 C 13.25 15.115 13.483 15.212 13.7 15.212 C 13.917 15.212 14.15 15.115 14.35 14.983 C 14.567 14.84 15 14.411 15 14.411 C 15 14.411 15.06 14.47 15.146 14.552 L 14.467 15.212 L 13.96 15.555 L 11.731 14.996 L 11.731 14.996 Z M 26.697 14.942 C 26.698 14.999 26.699 15.056 26.7 15.113 L 26.692 15.116 C 26.694 15.058 26.696 15 26.697 14.942 L 26.697 14.942 Z" />
</svg>
diff --git a/web/images/natural-events/icon-severe-storms.svg b/web/images/natural-events/icon-severe-storms.svg
index 1a6df227e..e1f8e64e8 100644
--- a/web/images/natural-events/icon-severe-storms.svg
+++ b/web/images/natural-events/icon-severe-storms.svg
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<svg viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg">
+<svg viewBox="0 0 30 30" width="26" height="26" xmlns="http://www.w3.org/2000/svg">
<circle cx="15" cy="15.25" r="13" style="fill:#465a64;" />
<path fill="#FFFFFF" d="M 8.755 16.553 C 8.744 16.554 5.945 16.84 6.123 14.33 C 6.181 13.517 7.086 12.725 7.636 12.806 C 7.371 12.379 7.587 10.845 9.353 10.168 C 10.252 9.823 11.754 9.631 13.464 10.472 C 13.464 10.472 13.119 9.952 12.339 9.751 C 13.264 7.376 19.205 8.099 19.261 9.256 C 19.306 8.91 19.107 8.61 18.641 8.468 C 19.755 7.919 22.854 9.679 21.99 12.208 C 23.588 11.899 24.645 14.43 23.204 15.295 C 23.206 14.922 23.014 14.661 22.996 14.669 C 23.226 16.067 21.996 16.55 21.99 16.553 L 16.692 16.553 L 16.004 17.961 L 18.065 18.346 L 12.74 25.591 L 15.398 19.633 L 13.597 19.263 L 14.599 16.553 L 8.755 16.553 L 8.755 16.553 Z M 19.261 12.437 C 19.027 11.477 17.78 10.125 16.084 11.268 C 17.874 10.732 19.349 12.069 18.844 14.076 C 19.133 13.662 19.312 13.257 19.287 12.854 C 20.742 13.146 20.738 14.439 20.216 15.295 C 21.134 14.651 21.041 12.664 19.261 12.437 Z M 11.963 12.497 C 10.924 10.996 7.703 12.481 9.459 14.937 C 8.696 12.528 11.137 11.701 11.963 12.497 L 11.963 12.497 Z"/>
</svg>
diff --git a/web/images/natural-events/icon-snow.svg b/web/images/natural-events/icon-snow.svg
index e00230bb9..b122a6075 100644
--- a/web/images/natural-events/icon-snow.svg
+++ b/web/images/natural-events/icon-snow.svg
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<svg viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg">
+<svg viewBox="0 0 30 30" width="26" height="26" xmlns="http://www.w3.org/2000/svg">
<circle cx="15" cy="15.25" r="13" style="fill:#5a7784;" />
<path fill="#FFFFFF" d="M 24.111 20.073 C 24.111 20.073 24.287 20.317 24.094 20.652 C 23.9 20.986 23.602 20.955 23.602 20.955 C 23.347 20.929 22.956 20.802 22.734 20.674 L 21.037 19.695 C 20.816 19.566 20.688 19.663 20.754 19.912 L 21.01 20.868 C 21.077 21.115 21.098 21.526 21.057 21.778 C 21.057 21.778 21.009 22.075 20.636 22.175 C 20.264 22.275 20.073 22.043 20.073 22.043 C 19.911 21.843 19.726 21.477 19.66 21.23 L 19.04 18.922 C 18.974 18.674 18.738 18.366 18.515 18.238 L 18.05 17.969 C 17.828 17.841 17.465 17.841 17.243 17.969 L 16.104 18.627 C 15.882 18.755 15.7 19.07 15.7 19.326 L 15.7 19.885 C 15.7 20.142 15.848 20.5 16.029 20.681 L 17.705 22.357 C 17.886 22.538 18.109 22.883 18.2 23.123 C 18.2 23.123 18.309 23.404 18.035 23.677 C 17.761 23.95 17.481 23.843 17.481 23.843 C 17.241 23.751 16.896 23.529 16.715 23.347 L 16.029 22.66 C 15.847 22.479 15.7 22.54 15.7 22.797 L 15.7 24.735 C 15.7 24.992 15.613 25.393 15.509 25.627 C 15.509 25.627 15.386 25.901 15 25.901 C 14.613 25.901 14.491 25.627 14.491 25.627 C 14.386 25.393 14.3 24.992 14.3 24.735 L 14.3 22.797 C 14.3 22.54 14.152 22.479 13.97 22.66 L 13.284 23.347 C 13.102 23.529 12.759 23.751 12.518 23.843 C 12.518 23.843 12.238 23.95 11.965 23.677 C 11.691 23.404 11.798 23.123 11.798 23.123 C 11.89 22.883 12.113 22.538 12.295 22.357 L 13.97 20.681 C 14.152 20.5 14.3 20.142 14.3 19.885 L 14.3 19.326 C 14.3 19.07 14.118 18.755 13.896 18.627 L 12.757 17.969 C 12.536 17.841 12.172 17.841 11.95 17.969 L 11.484 18.238 C 11.262 18.366 11.026 18.674 10.959 18.922 L 10.341 21.23 C 10.274 21.477 10.088 21.843 9.926 22.043 C 9.926 22.043 9.736 22.274 9.364 22.175 C 8.99 22.075 8.943 21.778 8.943 21.778 C 8.902 21.526 8.923 21.115 8.989 20.868 L 9.246 19.912 C 9.312 19.663 9.184 19.566 8.962 19.695 L 7.266 20.674 C 7.043 20.802 6.654 20.929 6.398 20.955 C 6.398 20.955 6.098 20.986 5.906 20.652 C 5.714 20.317 5.888 20.073 5.888 20.073 C 6.039 19.866 6.343 19.591 6.565 19.462 L 8.239 18.496 C 8.461 18.368 8.44 18.209 8.193 18.143 L 7.273 17.896 C 7.026 17.83 6.661 17.643 6.461 17.482 C 6.461 17.482 6.229 17.292 6.328 16.919 C 6.412 16.607 6.695 16.4 7.004 16.4 C 7.063 16.4 7.388 16.478 7.635 16.545 L 9.906 17.153 C 10.154 17.219 10.539 17.169 10.76 17.041 L 11.25 16.758 C 11.472 16.63 11.654 16.315 11.654 16.058 L 11.654 14.744 C 11.654 14.487 11.472 14.172 11.25 14.044 L 10.797 13.783 C 10.575 13.655 10.191 13.604 9.944 13.67 L 7.635 14.289 C 7.388 14.355 6.977 14.376 6.725 14.335 C 6.725 14.335 6.428 14.288 6.328 13.914 C 6.228 13.542 6.461 13.352 6.461 13.352 C 6.661 13.19 7.026 13.004 7.273 12.937 L 8.229 12.681 C 8.478 12.614 8.499 12.455 8.276 12.328 L 6.565 11.339 C 6.343 11.211 6.038 10.936 5.888 10.729 C 5.888 10.729 5.713 10.485 5.905 10.151 C 6.036 9.926 6.27 9.8 6.512 9.8 C 6.63 9.8 7.043 10 7.266 10.128 L 8.952 11.102 C 9.174 11.231 9.302 11.133 9.235 10.884 L 8.989 9.966 C 8.922 9.718 8.901 9.308 8.942 9.055 C 8.942 9.055 8.989 8.759 9.363 8.659 C 9.423 8.642 9.485 8.634 9.544 8.634 C 9.854 8.634 9.951 8.772 9.951 8.772 C 10.099 8.982 10.274 9.356 10.34 9.604 L 10.949 11.874 C 11.015 12.122 11.251 12.43 11.473 12.559 L 11.949 12.832 C 12.171 12.961 12.535 12.961 12.757 12.832 L 13.896 12.175 C 14.118 12.047 14.3 11.732 14.3 11.476 L 14.3 10.948 C 14.3 10.692 14.151 10.333 13.97 10.152 L 12.294 8.476 C 12.113 8.295 11.89 7.95 11.798 7.711 C 11.798 7.711 11.691 7.431 11.964 7.157 C 12.101 7.021 12.28 6.952 12.46 6.952 C 12.638 6.952 13.102 7.306 13.284 7.487 L 13.97 8.173 C 14.151 8.354 14.3 8.293 14.3 8.037 L 14.3 6.067 C 14.3 5.811 14.386 5.409 14.491 5.175 C 14.491 5.175 14.613 4.901 14.999 4.901 C 15.386 4.901 15.508 5.175 15.508 5.177 C 15.612 5.41 15.699 5.812 15.699 6.069 L 15.699 8.038 C 15.699 8.294 15.847 8.356 16.028 8.174 L 16.714 7.488 C 16.896 7.307 17.24 7.083 17.48 6.993 C 17.48 6.993 17.76 6.885 18.033 7.159 C 18.307 7.432 18.2 7.712 18.2 7.712 C 18.109 7.951 17.886 8.296 17.705 8.478 L 16.028 10.153 C 15.847 10.334 15.699 10.693 15.699 10.949 L 15.699 11.476 C 15.699 11.733 15.881 12.048 16.103 12.176 L 17.243 12.834 C 17.464 12.962 17.827 12.962 18.049 12.834 L 18.525 12.559 C 18.747 12.431 18.983 12.123 19.049 11.875 L 19.658 9.605 C 19.724 9.357 19.899 8.983 20.049 8.773 C 20.049 8.773 20.146 8.636 20.455 8.636 C 20.514 8.636 20.575 8.643 20.635 8.66 C 21.008 8.759 21.056 9.056 21.056 9.056 C 21.097 9.309 21.076 9.719 21.009 9.967 L 20.764 10.886 C 20.698 11.134 20.824 11.232 21.046 11.103 L 22.733 10.128 C 22.956 10.001 23.368 9.802 23.487 9.802 C 23.728 9.802 23.963 9.927 24.094 10.152 C 24.286 10.486 24.111 10.729 24.111 10.729 C 23.96 10.938 23.654 11.212 23.432 11.341 L 21.722 12.328 C 21.5 12.456 21.521 12.616 21.769 12.682 L 22.726 12.938 C 22.973 13.005 23.338 13.192 23.537 13.354 C 23.537 13.354 23.771 13.543 23.67 13.916 C 23.571 14.289 23.274 14.337 23.274 14.337 C 23.021 14.378 22.611 14.356 22.362 14.29 L 20.056 13.672 C 19.807 13.606 19.422 13.656 19.2 13.784 L 18.75 14.045 C 18.528 14.173 18.345 14.488 18.345 14.745 L 18.345 16.06 C 18.345 16.316 18.528 16.631 18.75 16.76 L 19.238 17.042 C 19.46 17.17 19.845 17.221 20.094 17.154 L 22.363 16.546 C 22.611 16.48 22.935 16.401 22.995 16.401 C 23.304 16.401 23.587 16.607 23.67 16.92 C 23.771 17.294 23.537 17.482 23.537 17.482 C 23.339 17.644 22.973 17.831 22.726 17.897 L 21.806 18.144 C 21.559 18.21 21.538 18.369 21.76 18.498 L 23.434 19.464 C 23.655 19.591 23.962 19.867 24.111 20.073 Z M 16.997 14.694 C 16.997 14.437 16.931 14.272 16.709 14.145 L 15.403 13.387 C 15.181 13.259 14.818 13.259 14.596 13.387 L 13.456 14.045 C 13.235 14.172 13.053 14.487 13.053 14.744 L 13.053 14.745 L 13.053 16.024 C 13.053 16.281 13.264 16.649 13.486 16.777 L 14.622 17.414 C 14.844 17.543 15.122 17.56 15.343 17.431 L 16.653 16.695 C 16.875 16.567 16.946 16.362 16.946 16.105 L 16.997 14.694 Z"/>
</svg>
diff --git a/web/images/natural-events/icon-volcanoes.svg b/web/images/natural-events/icon-volcanoes.svg
index 2d2166879..323b6b890 100644
--- a/web/images/natural-events/icon-volcanoes.svg
+++ b/web/images/natural-events/icon-volcanoes.svg
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<svg viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg">
+<svg viewBox="0 0 30 30" width="26" height="26" xmlns="http://www.w3.org/2000/svg">
<circle cx="15" cy="15.25" r="13" style="fill:#a6744a;" />
<path fill="#FFFFFF" d="M 24.962 21.352 C 22.898 24.679 19.212 26.897 15.011 26.897 C 10.795 26.897 7.097 24.662 5.038 21.314 L 11.839 11.918 C 13.963 12.922 15.911 12.907 17.69 11.918 L 24.962 21.352 Z M 17.756 15.551 C 17.756 15.551 19.408 20.833 20.291 23.027 C 20.381 23.251 20.637 23.36 20.861 23.27 C 21.086 23.18 21.194 22.924 21.104 22.7 C 20.222 20.506 17.756 15.551 17.756 15.551 L 17.756 15.551 Z M 11.428 15.252 C 11.428 15.252 8.827 18.77 7.874 20.374 C 7.752 20.582 7.819 20.851 8.027 20.974 C 8.235 21.098 8.505 21.03 8.628 20.822 C 9.581 19.218 11.428 15.252 11.428 15.252 Z M 16.063 14.458 C 16.063 14.458 16.051 17.701 16.219 19.07 C 16.246 19.292 16.448 19.451 16.67 19.424 C 16.892 19.396 17.052 19.194 17.024 18.971 C 16.857 17.603 16.063 14.458 16.063 14.458 L 16.063 14.458 Z M 15.011 11.918 C 14.904 10.052 15.005 8.101 15.681 5.939 L 16.094 6.03 C 15.319 8.225 15.105 10.084 15.011 11.918 L 15.011 11.918 Z M 13.168 11.262 C 12.377 9.917 11.668 9.054 10.236 7.794 L 10.504 7.511 C 11.729 8.655 12.565 9.922 13.168 11.262 Z M 16.722 11.229 C 16.811 9.81 17.198 8.523 18.2 7.511 L 18.51 7.809 C 17.492 8.571 17.04 9.762 16.722 11.229 Z M 10.238 6.422 L 9.183 5.978 L 8.709 6.117 L 8.574 7.107 L 8.86 7.184 L 9.245 8.016 L 9.694 7.948 L 10.36 6.873 L 10.238 6.422 L 10.238 6.422 Z M 19.156 7.919 L 20.257 7.634 L 20.851 6.921 L 20.177 6.11 L 19.443 6.198 L 18.601 6.058 L 18.239 7.017 L 19.156 7.919 Z M 17.229 5.257 L 17.13 4.664 L 16.243 3.951 L 15.765 4.079 L 15.143 4.49 L 15.316 5.361 L 16.784 5.81 L 17.229 5.257 L 17.229 5.257 Z" />
</svg>
diff --git a/web/images/natural-events/icon-water-color.svg b/web/images/natural-events/icon-water-color.svg
index 670eed08b..058c4bb6e 100644
--- a/web/images/natural-events/icon-water-color.svg
+++ b/web/images/natural-events/icon-water-color.svg
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<svg viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg">
+<svg viewBox="0 0 30 30" width="26" height="26" xmlns="http://www.w3.org/2000/svg">
<circle cx="15" cy="15.25" r="13" style="fill:#457d73;" />
<path fill="#FFFFFF" d="M 22.716 13.941 L 25.045 18.093 C 25.105 18.039 25.164 17.984 25.217 17.935 L 23.078 14.123 C 23.206 14.24 23.351 14.365 23.45 14.431 C 23.48 14.451 23.511 14.47 23.543 14.488 L 25.386 17.773 C 25.395 17.764 25.4 17.759 25.4 17.759 C 25.4 17.759 25.67 18.026 25.89 18.209 L 23.883 14.631 C 23.956 14.649 24.029 14.66 24.1 14.66 C 24.119 14.66 24.139 14.659 24.158 14.658 L 26.249 18.385 C 24.847 23.276 20.339 26.859 15 26.859 C 9.494 26.859 4.871 23.047 3.628 17.92 L 3.882 18.373 C 3.905 18.36 3.928 18.346 3.95 18.331 C 3.985 18.308 4.026 18.277 4.069 18.242 L 3.475 17.183 C 3.439 16.976 3.408 16.766 3.383 16.555 L 4.245 18.093 C 4.305 18.039 4.364 17.984 4.417 17.935 L 3.33 15.998 C 3.318 15.829 3.309 15.66 3.305 15.489 L 4.586 17.773 C 4.595 17.764 4.6 17.759 4.6 17.759 C 4.6 17.759 4.87 18.026 5.09 18.209 L 3.301 15.019 C 3.302 14.899 3.305 14.779 3.311 14.66 C 3.326 14.659 3.342 14.659 3.358 14.658 L 5.494 18.465 C 5.596 18.509 5.701 18.541 5.804 18.554 L 3.591 14.609 C 3.662 14.586 3.732 14.555 3.8 14.519 L 6.058 18.544 C 6.132 18.53 6.207 18.506 6.28 18.476 L 3.994 14.4 C 4.047 14.361 4.109 14.311 4.173 14.256 L 6.482 18.373 C 6.505 18.36 6.528 18.346 6.55 18.331 C 6.585 18.308 6.626 18.277 6.669 18.242 L 4.346 14.101 C 4.411 14.041 4.471 13.984 4.516 13.941 L 6.845 18.093 C 6.905 18.039 6.964 17.984 7.017 17.935 L 4.878 14.123 C 5.006 14.24 5.151 14.365 5.25 14.431 C 5.28 14.451 5.311 14.47 5.343 14.488 L 7.186 17.773 C 7.195 17.764 7.2 17.759 7.2 17.759 C 7.2 17.759 7.47 18.026 7.69 18.209 L 5.683 14.631 C 5.756 14.649 5.829 14.66 5.9 14.66 C 5.919 14.66 5.939 14.659 5.958 14.658 L 8.094 18.465 C 8.196 18.509 8.301 18.541 8.404 18.554 L 6.191 14.609 C 6.262 14.586 6.332 14.555 6.4 14.519 L 8.658 18.544 C 8.732 18.53 8.807 18.506 8.88 18.476 L 6.594 14.4 C 6.647 14.361 6.709 14.311 6.773 14.256 L 9.082 18.373 C 9.105 18.36 9.128 18.346 9.15 18.331 C 9.185 18.308 9.226 18.277 9.269 18.242 L 6.946 14.101 C 7.011 14.041 7.071 13.984 7.116 13.941 L 9.445 18.093 C 9.505 18.039 9.564 17.984 9.617 17.935 L 7.478 14.123 C 7.606 14.24 7.751 14.365 7.85 14.431 C 7.88 14.451 7.911 14.47 7.943 14.488 L 9.786 17.773 C 9.795 17.764 9.8 17.759 9.8 17.759 C 9.8 17.759 10.07 18.026 10.29 18.209 L 8.283 14.631 C 8.356 14.649 8.429 14.66 8.5 14.66 C 8.519 14.66 8.539 14.659 8.558 14.658 L 10.694 18.465 C 10.796 18.509 10.901 18.541 11.004 18.554 L 8.791 14.609 C 8.862 14.586 8.932 14.555 9 14.519 L 11.258 18.544 C 11.332 18.53 11.407 18.506 11.48 18.476 L 9.194 14.4 C 9.247 14.361 9.309 14.311 9.373 14.256 L 11.682 18.373 C 11.705 18.36 11.728 18.346 11.75 18.331 C 11.785 18.308 11.826 18.277 11.869 18.242 L 9.546 14.101 C 9.611 14.041 9.671 13.984 9.716 13.941 L 12.045 18.093 C 12.105 18.039 12.164 17.984 12.217 17.935 L 10.078 14.123 C 10.206 14.24 10.351 14.365 10.45 14.431 C 10.48 14.451 10.511 14.47 10.543 14.488 L 12.386 17.773 C 12.395 17.764 12.4 17.759 12.4 17.759 C 12.4 17.759 12.67 18.026 12.89 18.209 L 10.883 14.631 C 10.956 14.649 11.029 14.66 11.1 14.66 C 11.119 14.66 11.139 14.659 11.158 14.658 L 13.294 18.465 C 13.396 18.509 13.501 18.541 13.604 18.554 L 11.391 14.609 C 11.462 14.586 11.532 14.555 11.6 14.519 L 13.858 18.544 C 13.932 18.53 14.007 18.506 14.08 18.476 L 11.794 14.4 C 11.847 14.361 11.909 14.311 11.973 14.256 L 14.282 18.373 C 14.305 18.36 14.328 18.346 14.35 18.331 C 14.385 18.308 14.426 18.277 14.469 18.242 L 12.146 14.101 C 12.211 14.041 12.271 13.984 12.316 13.941 L 14.645 18.093 C 14.705 18.039 14.764 17.984 14.817 17.935 L 12.678 14.123 C 12.806 14.24 12.951 14.365 13.05 14.431 C 13.08 14.451 13.111 14.47 13.143 14.488 L 14.986 17.773 C 14.995 17.764 15 17.759 15 17.759 C 15 17.759 15.27 18.026 15.49 18.209 L 13.483 14.631 C 13.556 14.649 13.629 14.66 13.7 14.66 C 13.719 14.66 13.739 14.659 13.758 14.658 L 15.894 18.465 C 15.996 18.509 16.101 18.541 16.204 18.554 L 13.991 14.609 C 14.062 14.586 14.132 14.555 14.2 14.519 L 16.458 18.544 C 16.532 18.53 16.607 18.506 16.68 18.476 L 14.394 14.4 C 14.447 14.361 14.509 14.311 14.573 14.256 L 16.882 18.373 C 16.905 18.36 16.928 18.346 16.95 18.331 C 16.985 18.308 17.026 18.277 17.069 18.242 L 14.746 14.101 C 14.811 14.041 14.871 13.984 14.916 13.941 L 17.245 18.093 C 17.305 18.039 17.364 17.984 17.417 17.935 L 15.278 14.123 C 15.406 14.24 15.551 14.365 15.65 14.431 C 15.68 14.451 15.711 14.47 15.743 14.488 L 17.586 17.773 C 17.595 17.764 17.6 17.759 17.6 17.759 C 17.6 17.759 17.87 18.026 18.09 18.209 L 16.083 14.631 C 16.156 14.649 16.229 14.66 16.3 14.66 C 16.319 14.66 16.339 14.659 16.358 14.658 L 18.494 18.465 C 18.596 18.509 18.701 18.541 18.804 18.554 L 16.591 14.609 C 16.662 14.586 16.732 14.555 16.8 14.519 L 19.058 18.544 C 19.132 18.53 19.207 18.506 19.28 18.476 L 16.994 14.4 C 17.047 14.361 17.109 14.311 17.173 14.256 L 19.482 18.373 C 19.505 18.36 19.528 18.346 19.55 18.331 C 19.585 18.308 19.626 18.277 19.669 18.242 L 17.346 14.101 C 17.411 14.041 17.471 13.984 17.516 13.941 L 19.845 18.093 C 19.905 18.039 19.964 17.984 20.017 17.935 L 17.878 14.123 C 18.006 14.24 18.151 14.365 18.25 14.431 C 18.28 14.451 18.311 14.47 18.343 14.488 L 20.186 17.773 C 20.195 17.764 20.2 17.759 20.2 17.759 C 20.2 17.759 20.47 18.026 20.69 18.209 L 18.683 14.631 C 18.756 14.649 18.829 14.66 18.9 14.66 C 18.919 14.66 18.939 14.659 18.958 14.658 L 21.094 18.465 C 21.196 18.509 21.301 18.541 21.404 18.554 L 19.191 14.609 C 19.262 14.586 19.332 14.555 19.4 14.519 L 21.658 18.544 C 21.732 18.53 21.807 18.506 21.88 18.476 L 19.594 14.4 C 19.647 14.361 19.709 14.311 19.773 14.256 L 22.082 18.373 C 22.105 18.36 22.128 18.346 22.15 18.331 C 22.185 18.308 22.226 18.277 22.269 18.242 L 19.946 14.101 C 20.011 14.041 20.071 13.984 20.116 13.941 L 22.445 18.093 C 22.505 18.039 22.564 17.984 22.617 17.935 L 20.478 14.123 C 20.606 14.24 20.751 14.365 20.85 14.431 C 20.88 14.451 20.911 14.47 20.943 14.488 L 22.786 17.773 C 22.795 17.764 22.8 17.759 22.8 17.759 C 22.8 17.759 23.07 18.026 23.29 18.209 L 21.283 14.631 C 21.356 14.649 21.429 14.66 21.5 14.66 C 21.519 14.66 21.539 14.659 21.558 14.658 L 23.694 18.465 C 23.796 18.509 23.901 18.541 24.004 18.554 L 21.791 14.609 C 21.862 14.586 21.932 14.555 22 14.519 L 24.258 18.544 C 24.332 18.53 24.407 18.506 24.48 18.476 L 22.194 14.4 C 22.247 14.361 22.309 14.311 22.373 14.256 L 24.682 18.373 C 24.705 18.36 24.728 18.346 24.75 18.331 C 24.785 18.308 24.826 18.277 24.869 18.242 L 22.546 14.101 C 22.611 14.041 22.671 13.984 22.716 13.941 Z M 24.6 14.519 L 26.412 17.749 C 26.387 17.857 26.361 17.965 26.334 18.073 L 24.391 14.609 C 24.462 14.586 24.532 14.555 24.6 14.519 Z M 24.973 14.256 L 26.546 17.06 C 26.527 17.178 26.506 17.295 26.483 17.412 L 24.794 14.4 C 24.847 14.361 24.909 14.311 24.973 14.256 Z M 25.316 13.941 L 26.644 16.309 C 26.632 16.437 26.617 16.566 26.6 16.693 L 25.146 14.101 C 25.211 14.041 25.271 13.984 25.316 13.941 Z M 25.678 14.123 C 25.806 14.24 25.951 14.365 26.05 14.431 C 26.08 14.451 26.111 14.47 26.143 14.488 L 26.696 15.474 C 26.692 15.618 26.686 15.761 26.677 15.903 L 25.678 14.123 Z M 26.483 14.631 C 26.552 14.648 26.622 14.659 26.689 14.66 C 26.694 14.778 26.698 14.897 26.699 15.016 L 26.483 14.631 Z" />
</svg>
diff --git a/web/images/natural-events/icon-wildfires.svg b/web/images/natural-events/icon-wildfires.svg
index 250f4f442..850eb57ef 100644
--- a/web/images/natural-events/icon-wildfires.svg
+++ b/web/images/natural-events/icon-wildfires.svg
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<svg viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg">
+<svg viewBox="0 0 30 30" width="26" height="26" xmlns="http://www.w3.org/2000/svg">
<circle cx="15" cy="15.25" r="13" style="fill:#8d3b36;" />
<path fill="#FFFFFF" d="M 19.972 19.66 C 21.192 22.456 19.548 26.188 15.27 26.165 C 12.146 26.148 11.158 24.164 10.556 23.061 C 9.953 21.958 9.597 18.878 11.8 15.786 C 15.546 10.527 10.184 8.806 14.599 4.221 C 13.792 6.587 15.455 8.749 16.78 10.433 C 17.292 9.653 17.631 8.798 17.056 7.337 C 22.128 12.681 17.784 14.644 19.972 19.66 Z M 13.867 16.48 C 10.69 22.851 15.545 24.738 17.009 23.243 C 18.974 21.237 15.939 19.613 16.793 15.864 C 15.98 16.655 15.735 18.663 15.902 20.032 C 15.568 19.93 13.864 18.849 13.867 16.48 Z M 9.138 20.926 C 9.025 13.704 11.504 15.564 9.138 10.864 C 9.82 14.627 6.697 13.737 9.138 20.926 Z M 20.848 18.274 C 20.98 15.669 23.048 14.892 20.682 12.19 C 21.364 14.354 19.536 15.439 20.848 18.274 Z M 15.087 18.143 C 15.406 14.468 18.123 15.198 16.572 12.671 C 16.071 15.078 13.834 14.687 15.087 18.143 Z M 12.143 11.154 C 12.311 12.222 12.192 12.875 11.098 14.551 C 11.906 11.194 9.077 11.616 11.913 6.859 C 11.484 9.322 11.917 9.719 12.143 11.154 Z"/>
</svg>
diff --git a/web/images/natural-events/pin.svg b/web/images/natural-events/pin.svg
index 990218d13..e5dc60813 100644
--- a/web/images/natural-events/pin.svg
+++ b/web/images/natural-events/pin.svg
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
-<svg viewBox="0 0 30 35" xmlns="http://www.w3.org/2000/svg">
+<svg viewBox="0 0 30 35" width="26" height="26" xmlns="http://www.w3.org/2000/svg">
<path d="M 24.911 5.317 C 19.439 -0.155 10.597 -0.11 5.124 5.362 C -0.349 10.834 -0.387 19.696 5.084 25.169 L 14.973 35 L 24.88 25.091 C 30.353 19.618 30.383 10.791 24.911 5.317 Z" style="fill: rgb(255, 255, 255); stroke: rgb(0, 0, 0); stroke-width: 0.25;"/>
</svg>
diff --git a/web/js/components/animation-widget/gif-panel.js b/web/js/components/animation-widget/gif-panel.js
index a855de9e8..790a0a41a 100644
--- a/web/js/components/animation-widget/gif-panel.js
+++ b/web/js/components/animation-widget/gif-panel.js
@@ -4,7 +4,7 @@ import SelectionList from '../util/selector';
import GifPanelGrid from './gif-panel-grid';
import Button from '../util/button';
import Checkbox from '../util/checkbox';
-import { getDimensions } from '../../modules/image-download/util';
+import { getDimensions } from '../../modules/gif-download/util';
const MAX_GIF_SIZE = 250;
const MAX_IMAGE_DIMENSION_SIZE = 8200;
diff --git a/web/js/components/animation-widget/gif-panel.test.js b/web/js/components/animation-widget/gif-panel.test.js
index 90c6a33ae..a0d3c4797 100644
--- a/web/js/components/animation-widget/gif-panel.test.js
+++ b/web/js/components/animation-widget/gif-panel.test.js
@@ -3,9 +3,9 @@
import { render, screen, fireEvent } from '@testing-library/react';
import '@testing-library/jest-dom';
import GifPanel from './gif-panel';
-import { getDimensions } from '../../modules/image-download/util';
+import { getDimensions } from '../../modules/gif-download/util';
-jest.mock('../../modules/image-download/util', () => ({
+jest.mock('../../modules/gif-download/util', () => ({
getDimensions: jest.fn(),
}));
diff --git a/web/js/components/dateline/datelines.js b/web/js/components/dateline/datelines.js
index 36cadad6c..a78a08bc9 100644
--- a/web/js/components/dateline/datelines.js
+++ b/web/js/components/dateline/datelines.js
@@ -113,7 +113,7 @@ function DateLines(props) {
const mapStateToProps = (state) => {
const {
- proj, map, compare, settings, modal,
+ proj, map, compare, settings, modal, imageDownload,
} = state;
const isImageDownload = modal.id === 'TOOLBAR_SNAPSHOT' && modal.isOpen;
const isGeographic = proj.selected.crs === CRS.GEOGRAPHIC;
@@ -125,7 +125,7 @@ const mapStateToProps = (state) => {
isCompareActive: compare.active,
mapIsRendered: map.rendered,
hideText: isImageDownload || !isGeographic,
- alwaysShow: isImageDownload || settings.alwaysShowDatelines,
+ alwaysShow: (isImageDownload && !imageDownload.inProgress) || settings.alwaysShowDatelines,
isMobilePhone,
isMobileTablet,
};
diff --git a/web/js/components/dateline/datelines.test.js b/web/js/components/dateline/datelines.test.js
index c6c68ce12..62bfefd39 100644
--- a/web/js/components/dateline/datelines.test.js
+++ b/web/js/components/dateline/datelines.test.js
@@ -68,6 +68,7 @@ describe('DateLines', () => {
settings: { alwaysShowDatelines: false },
modal: { id: '', isOpen: false },
screenSize: { isMobilePhone: false, isMobileTablet: false },
+ imageDownload: { inProgress: false },
});
});
diff --git a/web/js/components/image-download/global-select.js b/web/js/components/image-download/global-select.js
index 64ef1f8a9..a632a80f2 100644
--- a/web/js/components/image-download/global-select.js
+++ b/web/js/components/image-download/global-select.js
@@ -7,7 +7,11 @@ const GLOBAL_LAT_LONG_EXTENT = [-180, -90, 180, 90];
function GlobalSelectCheckbox(props) {
const {
- onLatLongChange, geoLatLong, proj, map,
+ onLatLongChange,
+ geoLatLong,
+ proj,
+ map,
+ handleChange = () => null,
} = props;
const boundingBoxArray = [...geoLatLong[0], ...geoLatLong[1]];
@@ -15,7 +19,7 @@ function GlobalSelectCheckbox(props) {
const [prevExtent, setPrevExtent] = useState(globalSelected
? [-40, -40, 40, 40]
: boundingBoxArray);
- const onCheck = () => {
+ const onCheck = (event) => {
const useExtent = globalSelected ? prevExtent : GLOBAL_LAT_LONG_EXTENT;
setPrevExtent(boundingBoxArray);
map.getView().setCenter([0, 0]);
@@ -23,6 +27,7 @@ function GlobalSelectCheckbox(props) {
setTimeout(() => {
onLatLongChange(useExtent);
}, 50);
+ handleChange(event);
};
const globalIsNotSelected = GLOBAL_LAT_LONG_EXTENT.some((latLongValue, index) => latLongValue !==
@@ -47,6 +52,7 @@ GlobalSelectCheckbox.propTypes = {
geoLatLong: PropTypes.oneOfType([PropTypes.array, PropTypes.oneOf(['null'])]),
proj: PropTypes.string,
map: PropTypes.oneOfType([PropTypes.object, PropTypes.oneOf(['null'])]),
+ handleChange: PropTypes.func,
};
export default GlobalSelectCheckbox;
diff --git a/web/js/components/image-download/grid.js b/web/js/components/image-download/grid.js
index 3797ab5fc..2f4a65402 100644
--- a/web/js/components/image-download/grid.js
+++ b/web/js/components/image-download/grid.js
@@ -37,8 +37,12 @@ export default class ResolutionTable extends React.Component {
render() {
const imageSize = this.renderImageSize();
const {
- width, height, maxImageSize, onClick, validLayers, validSize,
+ width, height, maxImageSize, onClick, validLayers, validSize, isSnapshotInProgress,
} = this.props;
+
+ const isDownloadDisabled = !validSize || !validLayers || isSnapshotInProgress;
+ const buttonText = isSnapshotInProgress ? 'Creating...' : 'Download';
+
return (
<div className="wv-image-download-grid">
<div className="grid-child grid-head">
@@ -65,11 +69,12 @@ export default class ResolutionTable extends React.Component {
</div>
<div className="grid-child wv-image-button">
<Button
- text="Download"
+ text={buttonText}
onClick={() => {
onClick(width, height);
}}
- valid={validSize && validLayers}
+ valid={!isDownloadDisabled}
+ disabled={isDownloadDisabled}
/>
</div>
</div>
@@ -84,4 +89,5 @@ ResolutionTable.propTypes = {
validLayers: PropTypes.bool,
validSize: PropTypes.bool,
width: PropTypes.number,
+ isSnapshotInProgress: PropTypes.bool,
};
diff --git a/web/js/components/image-download/image-download-panel.js b/web/js/components/image-download/image-download-panel.js
index 3d4f62206..bce171f85 100644
--- a/web/js/components/image-download/image-download-panel.js
+++ b/web/js/components/image-download/image-download-panel.js
@@ -1,32 +1,39 @@
-import { useState, useEffect } from 'react';
-import { useSelector } from 'react-redux';
+import { useState, useEffect, useRef } from 'react';
+import { connect } from 'react-redux';
import PropTypes from 'prop-types';
-
import googleTagManager from 'googleTagManager';
-import { getActivePalettes } from '../../modules/palettes/selectors';
+import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import {
imageSizeValid,
+ estimateMaxImageSize,
getDimensions,
- getDownloadUrl,
getTruncatedGranuleDates,
GRANULE_LIMIT,
+ snapshot,
} from '../../modules/image-download/util';
import SelectionList from '../util/selector';
+import { openCustomContent } from '../../modules/modal/actions';
import ResTable from './grid';
import AlertUtil from '../util/alert';
import LatLongSelect from './lat-long-inputs';
import GlobalSelectCheckbox from './global-select';
+import WaitOverlay from './wait';
+import SnapshotError from './snapshot-error';
+import onClickFeedback from '../../modules/feedback/util';
+import initFeedback from '../../modules/feedback/actions';
+import { subdailyLayersActive } from '../../modules/layers/selectors';
-const MAX_DIMENSION_SIZE = 8200;
const RESOLUTION_KEY = {
- 0.125: '30m',
- 0.25: '60m',
- 0.5: '125m',
- 1: '250m',
- 2: '500m',
- 4: '1km',
- 20: '5km',
- 40: '10km',
+ 0.075: '7.5cm',
+ 0.3: '30cm',
+ 30: '30m',
+ 60: '60m',
+ 125: '125m',
+ 250: '250m',
+ 500: '500m',
+ 1_000: '1km',
+ 5_000: '5km',
+ 10_000: '10km',
};
function ImageDownloadPanel(props) {
@@ -35,11 +42,9 @@ function ImageDownloadPanel(props) {
isWorldfile = false,
resolution = '1',
getLayers,
- url,
lonlats,
projection,
date,
- markerCoordinates,
onPanelChange,
fileTypeOptions = true,
fileTypes,
@@ -49,23 +54,48 @@ function ImageDownloadPanel(props) {
map,
viewExtent,
resolutions,
- maxImageSize = '8200px x 8200px',
- firstLabel = 'Resolution (per pixel)',
+ firstLabel,
geoLatLong,
onLatLongChange,
+ boundaries,
+ openSnapshotErrorModal,
+ feedbackIsInitiated,
+ isMobile,
+ isSubdaily,
+ sendFeedback,
+ onResolutionChange,
+ onProgressChange,
} = props;
const [currFileType, setFileType] = useState(fileType);
const [currIsWorldfile, setIsWorldfile] = useState(isWorldfile);
const [currResolution, setResolution] = useState(resolution);
- const [debugUrl, setDebugUrl] = useState('');
const [showGranuleWarning, setShowGranuleWarning] = useState(false);
- const activePalettes = useSelector((state) => getActivePalettes(
- state,
- state.compare.activeString,
- ));
+ const [maxWidth, setMaxWidth] = useState(0);
+ const [maxHeight, setMaxHeight] = useState(0);
+ const [isSnapshotInProgress, setIsSnapshotInProgress] = useState(false);
+ const [snapshotStatus, setSnapshotStatus] = useState('');
+ const abortControllerRef = useRef(null);
+
+ const onCancelSnapshot = () => {
+ abortControllerRef.current?.abort();
+ setIsSnapshotInProgress(false);
+ setSnapshotStatus('');
+ onProgressChange(false);
+ };
+
+ const changeResolution = (res) => {
+ onResolutionChange(res);
+ setResolution(res);
+ };
useEffect(() => {
+ const divElem = document.querySelector('body');
+ const resizeHandler = async () => {
+ const { height, width } = await estimateMaxImageSize(map, Number(currResolution));
+ setMaxHeight(height);
+ setMaxWidth(width);
+ };
const layerList = getLayers();
const granuleDatesMap = new Map(map.getLayers().getArray()
.map((layer) => [
@@ -76,57 +106,99 @@ function ImageDownloadPanel(props) {
...def, granuleDates: granuleDatesMap.get(def.id),
}));
const isTruncated = getTruncatedGranuleDates(layerDefs, date).truncated;
+ const resizeObserver = new ResizeObserver(resizeHandler);
+ resizeObserver.observe(divElem);
+ resizeHandler();
setShowGranuleWarning(isTruncated);
+
+ return () => {
+ resizeObserver.unobserve(divElem);
+ // Clean up any ongoing snapshot operation when component unmounts
+ onCancelSnapshot();
+ };
}, []);
useEffect(() => {
- setResolution(resolution);
+ changeResolution(resolution);
}, [resolution]);
- const onDownload = (width, height) => {
- const time = new Date(date.getTime());
-
+ const onDownload = async (width, height) => {
const layerList = getLayers();
- const granuleDatesMap = new Map(map.getLayers().getArray()
- .map((layer) => [
- layer.wv.id, layer.wv.granuleDates,
- ]));
- const layerDefs = layerList.map((def) => ({
- ...def, granuleDates: granuleDatesMap.get(def.id),
- }));
- const dlURL = getDownloadUrl(
- url,
+ const snapshotFormat = currFileType === 'application/vnd.google-earth.kmz' ? 'kmz' : currFileType.split('/').at(-1);
+
+ // Create abort controller for this snapshot operation
+ const abortController = new AbortController();
+ abortControllerRef.current = abortController;
+ setIsSnapshotInProgress(true);
+ setSnapshotStatus('Preparing snapshot...');
+ onProgressChange(true);
+
+ let formattedDate = date.toISOString();
+ if (!isSubdaily) {
+ formattedDate = formattedDate.split('T')[0];
+ }
+
+ const snapshotOptions = {
+ format: snapshotFormat,
+ metersPerPixel: Number(currResolution),
+ pixelBbox: boundaries,
+ map,
+ worldfile: currIsWorldfile,
+ abortSignal: abortController.signal,
+ filename: `snapshot-${formattedDate}`,
projection,
- layerDefs,
- lonlats,
- { width, height },
- time,
- currFileType,
- currFileType === 'application/vnd.google-earth.kmz' ? false : currIsWorldfile,
- markerCoordinates,
- activePalettes,
- );
+ onerror: openSnapshotErrorModal,
+ width,
+ height,
+ };
- window.open(dlURL, '_blank');
- googleTagManager.pushEvent({
- event: 'image_download',
- layers: {
- activeCount: layerList.length,
- },
- image: {
- resolution: RESOLUTION_KEY[currResolution],
- format: currFileType,
- worldfile: currIsWorldfile,
- },
- });
- setDebugUrl(dlURL);
+ const timeout = setTimeout(onCancelSnapshot, 180_000);
+ try {
+ setSnapshotStatus('Creating snapshot...');
+ const startTime = Date.now();
+ await snapshot(snapshotOptions);
+ const endTime = Date.now();
+ setSnapshotStatus('Download complete!');
+
+ googleTagManager.pushEvent({
+ event: 'image_download',
+ layers: {
+ activeCount: layerList.length,
+ },
+ duration: endTime - startTime,
+ image: {
+ resolution: RESOLUTION_KEY[currResolution],
+ format: currFileType,
+ worldfile: currIsWorldfile,
+ },
+ });
+ } catch (error) {
+ if (error.name === 'AbortError') {
+ console.warn('Snapshot operation was cancelled by user');
+ } else {
+ throw new Error('Snapshot operation failed', { cause: error });
+ }
+ } finally {
+ // Add a delay to show the 'Download complete!' message before clearing UI
+ if (snapshotStatus === 'Download complete!') {
+ await new Promise((resolve) => {
+ setTimeout(resolve, 2000);
+ });
+ }
+ clearTimeout(timeout);
+ setIsSnapshotInProgress(false);
+ setSnapshotStatus('');
+ onProgressChange(false);
+ abortControllerRef.current = null;
+ changeResolution(currResolution);
+ }
};
const handleChange = (type, value) => {
let valueIn = value;
if (type === 'resolution') {
- setResolution(valueIn);
+ changeResolution(valueIn);
} else if (type === 'worldfile') {
valueIn = Boolean(Number(value));
setIsWorldfile(valueIn);
@@ -191,8 +263,15 @@ function ImageDownloadPanel(props) {
/>
);
+ const handleKeyDown = (e, feedbackIsInitiatedArg, isMobileArg) => {
+ if (e.key === 'Enter') {
+ return sendFeedback(feedbackIsInitiatedArg, isMobileArg);
+ }
+ return null;
+ };
+
const { crs } = projection.selected;
- const dimensions = getDimensions(projection.id, lonlats, currResolution);
+ const dimensions = getDimensions(map, lonlats, currResolution);
const { height } = dimensions;
const { width } = dimensions;
const filetypeSelect = renderFileTypeSelect();
@@ -202,13 +281,13 @@ function ImageDownloadPanel(props) {
return (
<>
{crossesDatelineAlert()}
- <div className="wv-re-pick-wrapper wv-image">
- <div
- id="wv-image-download-url"
- style={{ display: 'none' }}
- // eslint-disable-next-line react/no-unknown-property
- url={debugUrl}
+ {isSnapshotInProgress && (
+ <WaitOverlay
+ statusText={snapshotStatus || 'Creating snapshot...'}
+ onCancel={onCancelSnapshot}
/>
+ )}
+ <div className="wv-re-pick-wrapper wv-image">
<div className="wv-image-header">
<SelectionList
id="wv-image-resolution"
@@ -246,17 +325,95 @@ function ImageDownloadPanel(props) {
<ResTable
width={width}
height={height}
- fileSize={((width * height * 24) / 8388608).toFixed(2)}
- maxImageSize={maxImageSize}
- validSize={imageSizeValid(height, width, MAX_DIMENSION_SIZE)}
+ fileSize={(((width * height) ** 0.89) * 6.88 / 8388608).toFixed(2)}
+ maxImageSize={`${maxWidth}px x ${maxHeight}px`}
+ validSize={imageSizeValid({
+ maxHeight,
+ maxWidth,
+ map,
+ resolution: Number(currResolution),
+ pixelBbox: boundaries,
+ })}
validLayers={layerList.length > 0}
onClick={onDownload}
+ isSnapshotInProgress={isSnapshotInProgress}
/>
+ <hr />
+ <p className="wv-snapshot-warning">
+ <span className="wv-snapshot-warning-icon">
+ <FontAwesomeIcon
+ icon="exclamation-triangle"
+ className="wv-alert-icon"
+ size="1x"
+ widthAuto
+ />
+ </span>
+ This snapshot feature has been upgraded to capture anything on the map,
+ including customized color palettes. If you notice any issues, please
+ {' '}
+ <span
+ className="snapshot-feedback"
+ role="link"
+ tabIndex={0}
+ onKeyDown={(e, feedbackIsInitiatedArg, isMobileArg) =>
+ handleKeyDown(e, feedbackIsInitiatedArg, isMobileArg)}
+ onClick={() => sendFeedback(feedbackIsInitiated, isMobile)}
+ >
+ contact us
+ </span>
+ .
+ </p>
</div>
</>
);
}
+const mapStateToProps = (state) => {
+ const {
+ feedback, screenSize,
+ } = state;
+ return {
+ feedbackIsInitiated: feedback.isInitiated,
+ isMobile: screenSize.isMobileDevice,
+ isSubdaily: subdailyLayersActive(state),
+ };
+};
+
+const mapDispatchToProps = (dispatch) => ({
+ openSnapshotErrorModal: () => {
+ dispatch(
+ openCustomContent('SNAPSHOT_ERROR_MODAL', {
+ headerText: 'Snapshot Error',
+ backdrop: false,
+ bodyComponent: SnapshotError,
+ wrapClassName: 'unclickable-behind-modal',
+ modalClassName: 'snapshot-error',
+ }),
+ );
+ },
+ sendFeedback: (isInitiated, isMobile) => {
+ onClickFeedback(isInitiated, isMobile);
+ if (!isInitiated) {
+ dispatch(initFeedback());
+ }
+ },
+});
+
+ImageDownloadPanel.defaultProps = {
+ fileType: 'image/jpeg',
+ fileTypeOptions: true,
+ firstLabel: 'Resolution (per pixel)',
+ isWorldfile: false,
+ resolution: 250,
+ secondLabel: 'Format',
+ worldFileOptions: true,
+};
+
+export default connect(
+ mapStateToProps,
+ mapDispatchToProps,
+)(ImageDownloadPanel);
+
ImageDownloadPanel.propTypes = {
datelineMessage: PropTypes.string,
fileType: PropTypes.string,
@@ -267,19 +424,22 @@ ImageDownloadPanel.propTypes = {
isWorldfile: PropTypes.bool,
lonlats: PropTypes.oneOfType([PropTypes.array, PropTypes.oneOf(['null'])]),
map: PropTypes.oneOfType([PropTypes.object, PropTypes.oneOf(['null'])]),
- maxImageSize: PropTypes.string,
- markerCoordinates: PropTypes.oneOfType([PropTypes.array, PropTypes.oneOf(['null'])]),
onPanelChange: PropTypes.func,
projection: PropTypes.oneOfType([PropTypes.object, PropTypes.oneOf(['null'])]),
date: PropTypes.oneOfType([PropTypes.object, PropTypes.oneOf(['null'])]),
- resolution: PropTypes.string,
+ resolution: PropTypes.number,
resolutions: PropTypes.oneOfType([PropTypes.object, PropTypes.oneOf(['null'])]),
secondLabel: PropTypes.string,
- url: PropTypes.string,
viewExtent: PropTypes.oneOfType([PropTypes.array, PropTypes.oneOf(['null'])]),
worldFileOptions: PropTypes.bool,
geoLatLong: PropTypes.oneOfType([PropTypes.array, PropTypes.oneOf(['null'])]),
onLatLongChange: PropTypes.func,
+ boundaries: PropTypes.array,
+ openSnapshotErrorModal: PropTypes.func,
+ feedbackIsInitiated: PropTypes.bool,
+ isMobile: PropTypes.bool,
+ isSubdaily: PropTypes.bool,
+ sendFeedback: PropTypes.func,
+ onResolutionChange: PropTypes.func,
+ onProgressChange: PropTypes.func,
};
-
-export default ImageDownloadPanel;
diff --git a/web/js/components/image-download/image-download-panel.test.js b/web/js/components/image-download/image-download-panel.test.js
index 2046ad1f3..336e0d1b8 100644
--- a/web/js/components/image-download/image-download-panel.test.js
+++ b/web/js/components/image-download/image-download-panel.test.js
@@ -8,18 +8,27 @@ jest.mock('react-redux', () => ({
compare: { activeString: 'a' },
palettes: { a: {} },
}),
+ connect: () => (Component) => Component,
}));
jest.mock('googleTagManager', () => ({
pushEvent: jest.fn(),
}));
+global.ResizeObserver = jest.fn().mockImplementation(() => ({
+ observe: jest.fn(),
+ unobserve: jest.fn(),
+ disconnect: jest.fn(),
+}));
+
// Mock util functions used by the component
jest.mock('../../modules/image-download/util', () => ({
imageSizeValid: jest.fn(() => true),
+ estimateMaxImageSize: jest.fn(() => ({ width: 8192, height: 8192 })),
getDimensions: jest.fn(() => ({ width: 10, height: 20 })),
getDownloadUrl: jest.fn((url) => `${url}?download=true`),
getTruncatedGranuleDates: jest.fn(() => ({ truncated: true })),
+ snapshot: jest.fn(),
GRANULE_LIMIT: 42,
}));
@@ -56,7 +65,6 @@ jest.mock('./global-select', () => (props) => (
));
import ImageDownloadPanel from './image-download-panel';
-import googleTagManager from 'googleTagManager';
import * as util from '../../modules/image-download/util';
describe('ImageDownloadPanel', () => {
@@ -82,6 +90,8 @@ describe('ImageDownloadPanel', () => {
resolutions: ['1', '2'],
geoLatLong: null,
onLatLongChange: jest.fn(),
+ onResolutionChange: jest.fn(),
+ onProgressChange: jest.fn(),
};
beforeEach(() => {
@@ -109,17 +119,6 @@ describe('ImageDownloadPanel', () => {
// click download button
fireEvent.click(screen.getByText('Download'));
-
- // window.open called with constructed URL
- expect(window.open).toHaveBeenCalledWith('http://example.com/wms?download=true', '_blank');
-
- // googleTagManager called
- expect(googleTagManager.pushEvent).toHaveBeenCalled();
-
- // debug url written to hidden div
- const urlDiv = document.getElementById('wv-image-download-url');
- // the component sets url as a prop; ensure exists
- expect(urlDiv).toBeInTheDocument();
});
test('worldfile select disabled for kmz', () => {
diff --git a/web/js/components/image-download/snapshot-error.js b/web/js/components/image-download/snapshot-error.js
new file mode 100644
index 000000000..fa78ad108
--- /dev/null
+++ b/web/js/components/image-download/snapshot-error.js
@@ -0,0 +1,12 @@
+function SnapshotError() {
+ const msg = 'An error occurred while creating this snapshot. Please try again.';
+ return (
+ <div className="snapshot-error-container">
+ <div className="snapshot-error-text">
+ {msg}
+ </div>
+ </div>
+ );
+}
+
+export default SnapshotError;
diff --git a/web/js/components/image-download/wait.js b/web/js/components/image-download/wait.js
new file mode 100644
index 000000000..ee445c2e1
--- /dev/null
+++ b/web/js/components/image-download/wait.js
@@ -0,0 +1,36 @@
+import { createPortal } from 'react-dom';
+import Button from '../util/button';
+
+import '../../../css/components/image-download/snapshot-progress.css';
+
+const Wait = (props) => {
+ const { complete = false, statusText, onCancel } = props;
+
+ const root = document.querySelector('.wv-content') || document.body;
+
+ return createPortal(
+ <div className="wv-snapshot-progress-overlay">
+ <dialog className="wv-snapshot-progress-dialog" open>
+ <div className="wv-snapshot-progress">
+ <div className="wv-snapshot-progress-message">
+ <span>{statusText}</span>
+ </div>
+ <div className="wv-snapshot-progress-actions">
+ {!complete && (
+ <Button
+ autoFocus
+ text="Cancel"
+ onClick={onCancel}
+ className="wv-button gray"
+ id="wv-snapshot-cancel-button"
+ />
+ )}
+ </div>
+ </div>
+ </dialog>
+ </div>,
+ root,
+ );
+};
+
+export default Wait;
diff --git a/web/js/components/sidebar/event-icon.js b/web/js/components/sidebar/event-icon.js
index 02fcdfdd4..8e400d215 100644
--- a/web/js/components/sidebar/event-icon.js
+++ b/web/js/components/sidebar/event-icon.js
@@ -1,19 +1,42 @@
import PropTypes from 'prop-types';
import { UncontrolledTooltip } from 'reactstrap';
+const eventMappings = {
+ dustHaze: 'dust-and-haze',
+ icebergs: 'icebergs',
+ floods: 'floods',
+ manmade: 'manmade',
+ seaLakeIce: 'icebergs',
+ severeStorms: 'severe-storms',
+ snow: 'snow',
+ volcanoes: 'volcanoes',
+ waterColor: 'water-color',
+ wildfires: 'wildfires',
+};
+
export default function EventIcon (props) {
const {
id,
category,
title,
hideTooltip,
+ withPin,
} = props;
return (
<div>
- <i
+ {withPin &&
+ (
+ <img
+ id={`${id + category}-pin`}
+ className={`event-icon-pin event-icon-${category}-pin`}
+ src="../images/natural-events/pin.svg"
+ />
+ )}
+ <img
id={id + category}
className={`event-icon event-icon-${category}`}
+ src={`../images/natural-events/icon-${eventMappings[category] || 'critical'}.svg`}
/>
{!hideTooltip && (
<UncontrolledTooltip
@@ -36,4 +59,5 @@ EventIcon.propTypes = {
category: PropTypes.string,
hideTooltip: PropTypes.bool,
title: PropTypes.string,
+ withPin: PropTypes.bool,
};
diff --git a/web/js/components/util/selector.js b/web/js/components/util/selector.js
index c6736d134..929a4c306 100644
--- a/web/js/components/util/selector.js
+++ b/web/js/components/util/selector.js
@@ -35,5 +35,5 @@ Selector.propTypes = {
onChange: PropTypes.func,
optionArray: PropTypes.oneOfType([PropTypes.object, PropTypes.oneOf(['null'])]),
optionName: PropTypes.string,
- value: PropTypes.string,
+ value: PropTypes.number || PropTypes.string,
};
diff --git a/web/js/containers/gif.js b/web/js/containers/gif.js
index eb0e28580..908d02b32 100644
--- a/web/js/containers/gif.js
+++ b/web/js/containers/gif.js
@@ -12,13 +12,13 @@ import GifPanel from '../components/animation-widget/gif-panel';
import util from '../util/util';
import Crop from '../components/util/image-crop';
import {
- resolutionsGeo,
- resolutionsPolar,
-} from '../modules/image-download/constants';
+ RESOLUTIONS_GEO,
+ RESOLUTIONS_POLAR,
+} from '../modules/gif-download/constants';
import {
imageUtilCalculateResolution,
imageUtilGetCoordsFromPixelValues,
-} from '../modules/image-download/util';
+} from '../modules/gif-download/util';
import { TIME_SCALE_FROM_NUMBER } from '../modules/date/constants';
import GifResults from '../components/animation-widget/gif-post-creation';
import getImageArray from '../modules/animation/selectors';
@@ -110,7 +110,7 @@ class GIF extends Component {
x, y, x2, y2,
} = boundaries;
const isGeoProjection = proj.id === 'geographic';
- const resolutions = isGeoProjection ? resolutionsGeo : resolutionsPolar;
+ const resolutions = isGeoProjection ? RESOLUTIONS_GEO : RESOLUTIONS_POLAR;
const lonlats = imageUtilGetCoordsFromPixelValues(
boundaries,
map.ui.selected,
diff --git a/web/js/containers/gif.test.js b/web/js/containers/gif.test.js
index 79ea83461..5b6446439 100644
--- a/web/js/containers/gif.test.js
+++ b/web/js/containers/gif.test.js
@@ -133,6 +133,7 @@ const defaultProps = {
ui: {
selected: {
getView: jest.fn(() => ({ getZoom: jest.fn(() => 3) })),
+ getCoordinateFromPixel: jest.fn(() => [0, 0]),
},
},
},
diff --git a/web/js/containers/image-download.js b/web/js/containers/image-download.js
index 2aff44453..568482758 100644
--- a/web/js/containers/image-download.js
+++ b/web/js/containers/image-download.js
@@ -19,14 +19,15 @@ import {
} from '../modules/layers/selectors';
import { getSelectedDate } from '../modules/date/selectors';
import {
- resolutionsGeo,
- resolutionsPolar,
+ RESOLUTIONS_GEO,
+ RESOLUTIONS_POLAR,
fileTypesGeo,
fileTypesPolar,
} from '../modules/image-download/constants';
import {
onPanelChange as onPanelChangeAction,
updateBoundaries,
+ updateInProgress,
} from '../modules/image-download/actions';
import { getNormalizedCoordinate } from '../components/location-search/util';
import { CRS } from '../modules/map/constants';
@@ -61,6 +62,7 @@ class ImageDownloadContainer extends Component {
this.debounceBoundaryStateUpdate = lodashDebounce(onBoundaryChange, 200);
this.onBoundaryChange = this.onBoundaryChange.bind(this);
this.onLatLongChange = this.onLatLongChange.bind(this);
+ this.onResolutionChange = this.onResolutionChange.bind(this);
}
/**
@@ -140,6 +142,16 @@ class ImageDownloadContainer extends Component {
this.debounceBoundaryStateUpdate(newBoundaries);
}
+ /**
+ * Update resolution value on change
+ * @param {Object} res
+ *
+ * @returns {null}
+ */
+ onResolutionChange(res) {
+ this.setState({ resolution: res });
+ }
+
render() {
const {
proj,
@@ -153,6 +165,7 @@ class ImageDownloadContainer extends Component {
hasSubdailyLayers,
markerCoordinates,
onPanelChange,
+ onProgressChange,
} = this.props;
const {
resolution, isWorldfile, fileType, bottomLeftLatLong, topRightLatLong, boundaries,
@@ -165,13 +178,14 @@ class ImageDownloadContainer extends Component {
const lonLat2 = olProj.transform(topRightLatLong, CRS.GEOGRAPHIC, crs);
const isGeoProjection = proj.id === 'geographic';
const fileTypes = isGeoProjection ? fileTypesGeo : fileTypesPolar;
- const resolutions = isGeoProjection ? resolutionsGeo : resolutionsPolar;
+ const resolutions = isGeoProjection ? RESOLUTIONS_GEO : RESOLUTIONS_POLAR;
const mapView = map.ui.selected.getView();
+ const center = mapView.getCenter();
const newResolution = resolution ||
imageUtilCalculateResolution(
Math.round(mapView.getZoom()),
- isGeoProjection,
- proj.selected.resolutions,
+ proj,
+ center,
);
const viewExtent = mapView.calculateExtent(map.ui.selected.getSize());
const normalizedBottomLeftLatLong = getNormalizedCoordinate(bottomLeftLatLong);
@@ -185,6 +199,7 @@ class ImageDownloadContainer extends Component {
fileType={fileType}
resolutions={resolutions}
lonlats={[lonLat1, lonLat2]}
+ boundaries={[x, y, x2, y2]}
resolution={newResolution}
isWorldfile={isWorldfile}
hasSubdailyLayers={hasSubdailyLayers}
@@ -203,6 +218,8 @@ class ImageDownloadContainer extends Component {
onLatLongChange={this.onLatLongChange}
geoLatLong={[normalizedBottomLeftLatLong, normalizedTopRightLatLong]}
map={map.ui.selected}
+ onResolutionChange={this.onResolutionChange}
+ onProgressChange={onProgressChange}
/>
<Crop
x={x}
@@ -286,6 +303,9 @@ const mapDispatchToProps = (dispatch) => ({
onBoundaryChange: (obj) => {
dispatch(updateBoundaries(obj));
},
+ onProgressChange: (obj) => {
+ dispatch(updateInProgress(obj));
+ },
});
export default connect(
@@ -298,6 +318,7 @@ ImageDownloadContainer.propTypes = {
fileType: PropTypes.string.isRequired,
map: PropTypes.oneOfType([PropTypes.object, PropTypes.oneOf(['null'])]),
onBoundaryChange: PropTypes.func.isRequired,
+ onProgressChange: PropTypes.func.isRequired,
onPanelChange: PropTypes.func.isRequired,
proj: PropTypes.oneOfType([PropTypes.object, PropTypes.oneOf(['null'])]),
url: PropTypes.string.isRequired,
diff --git a/web/js/containers/image-download.test.js b/web/js/containers/image-download.test.js
index 850391ccb..ed4f9b96a 100644
--- a/web/js/containers/image-download.test.js
+++ b/web/js/containers/image-download.test.js
@@ -81,6 +81,7 @@ const makeMapUi = () => ({
getView: jest.fn(() => ({
getZoom: jest.fn(() => 4),
calculateExtent: jest.fn(() => [0, 0, 100, 100]),
+ getCenter: jest.fn(() => [0, 0]),
})),
getSize: jest.fn(() => [1024, 768]),
},
diff --git a/web/js/containers/toolbar.js b/web/js/containers/toolbar.js
index a6f614f01..f8d9d8348 100644
--- a/web/js/containers/toolbar.js
+++ b/web/js/containers/toolbar.js
@@ -4,7 +4,6 @@ import { connect } from 'react-redux';
import { ButtonToolbar, Button } from 'reactstrap';
import {
get as lodashGet,
- cloneDeep as lodashCloneDeep,
filter as lodashFilter,
} from 'lodash';
import Promise from 'bluebird';
@@ -21,14 +20,13 @@ import {
requestNotifications as requestNotificationsAction,
setNotifications,
} from '../modules/notifications/actions';
-import { clearCustomsSnapshot, refreshPalettes } from '../modules/palettes/actions';
+import { refreshPalettes } from '../modules/palettes/actions';
import { clearRotate, refreshRotation } from '../modules/map/actions';
import {
showLayers, hideLayers,
} from '../modules/layers/actions';
import { notificationWarnings } from '../modules/image-download/constants';
import Notify from '../components/image-download/notify';
-import { hasCustomPaletteInActiveProjection } from '../modules/palettes/util';
import LocationSearch from '../components/location-search/location-search';
import {
toggleShowLocationSearch as toggleShowLocationSearchAction,
@@ -126,9 +124,7 @@ class toolbarContainer extends Component {
async openImageDownload() {
const {
openModal,
- hasCustomPalette,
isRotated,
- activePalettes,
rotation,
refreshStateAfterImageDownload,
toggleDialogVisible,
@@ -136,21 +132,21 @@ class toolbarContainer extends Component {
visibleLayersForProj,
} = this.props;
const nonDownloadableLayers = hasNonDownloadableLayer
- ? getNonDownloadableLayers(visibleLayersForProj)
+ ? getNonDownloadableLayers(visibleLayersForProj, true)
: null;
- const paletteStore = lodashCloneDeep(activePalettes);
toggleDialogVisible(false);
- await this.getPromise(hasCustomPalette, 'palette', clearCustomsSnapshot, 'Notice');
await this.getPromise(isRotated, 'rotate', clearRotate, 'Reset rotation');
await this.getPromise(hasNonDownloadableLayer, 'layers', hideLayers, 'Remove Layers?');
+ // Allow time for view to un-rotate
+ if (isRotated) {
+ await new Promise(resolve => setTimeout(resolve, 500));
+ }
await openModal(
'TOOLBAR_SNAPSHOT',
{
...CUSTOM_MODAL_PROPS.TOOLBAR_SNAPSHOT,
onClose: () => {
- refreshStateAfterImageDownload(hasCustomPalette
- ? paletteStore
- : undefined, rotation, nonDownloadableLayers);
+ refreshStateAfterImageDownload(undefined, rotation, nonDownloadableLayers);
},
},
);
@@ -468,7 +464,6 @@ const mapStateToProps = (state) => {
modal,
modalAbout,
notifications,
- palettes,
proj,
screenSize,
sidebar,
@@ -476,29 +471,25 @@ const mapStateToProps = (state) => {
} = state;
const { isDistractionFreeModeActive, isKioskModeActive } = ui;
const { numberUnseen, type } = notifications;
- const { activeString } = compare;
const activeLayersForProj = getAllActiveLayers(state);
const isMobile = screenSize.isMobileDevice;
const faSize = isMobile ? '2x' : '1x';
const isCompareActive = compare.active;
const isChartingActive = charting.active;
const isLocationSearchExpanded = locationSearch.isExpanded;
- const activePalettes = palettes[activeString];
const { isAnimatingToEvent } = events;
const { activeTab } = sidebar;
const isDataDownloadTabActive = activeTab === 'download';
const { isOpen: modalIsOpen } = modal;
- const filteredLayers = activeLayersForProj.filter((layer) => !(layer.colormapType === 'classification' && layer.type !== 'vector'));
// Collapse when Image download / GIF / is open or measure tool active
const snapshotModalOpen = modalIsOpen && modal.id === 'TOOLBAR_SNAPSHOT';
const shouldBeCollapsed = snapshotModalOpen || measure.isActive || animation.gifActive;
const visibleLayersForProj = lodashFilter(activeLayersForProj, 'visible');
return {
- activePalettes,
config: state.config,
faSize,
- hasNonDownloadableLayer: hasNonDownloadableVisibleLayer(visibleLayersForProj),
+ hasNonDownloadableLayer: hasNonDownloadableVisibleLayer(visibleLayersForProj, true),
isAboutOpen: modalAbout.isOpen,
isCompareActive,
isChartingActive,
@@ -514,10 +505,6 @@ const mapStateToProps = (state) => {
isLocationSearchExpanded,
isMobile,
isRotated: Boolean(map.rotation !== 0),
- hasCustomPalette: hasCustomPaletteInActiveProjection(
- filteredLayers,
- activePalettes,
- ),
modalIsOpen,
notificationType: type,
notificationContentNumber: numberUnseen,
@@ -568,9 +555,9 @@ const mapDispatchToProps = (dispatch) => ({
);
},
notify: (type, action, visibleLayersForProj) => new Promise((resolve, reject, cancel) => {
- const nonDownloadableLayers = type !== 'layers' ? null : getNonDownloadableLayers(visibleLayersForProj);
+ const nonDownloadableLayers = type !== 'layers' ? null : getNonDownloadableLayers(visibleLayersForProj, true);
const bodyComponentProps = {
- bodyText: type !== 'layers' ? notificationWarnings[type] : getNonDownloadableLayerWarning(nonDownloadableLayers),
+ bodyText: type !== 'layers' ? notificationWarnings[type] : getNonDownloadableLayerWarning(nonDownloadableLayers, true),
cancel: () => {
dispatch(onToggle());
},
@@ -608,11 +595,9 @@ export default connect(
)(toolbarContainer);
toolbarContainer.propTypes = {
- activePalettes: PropTypes.oneOfType([PropTypes.object, PropTypes.oneOf(['null'])]),
hasNonDownloadableLayer: PropTypes.bool,
config: PropTypes.oneOfType([PropTypes.object, PropTypes.oneOf(['null'])]),
faSize: PropTypes.string,
- hasCustomPalette: PropTypes.bool,
isAboutOpen: PropTypes.bool,
isCompareActive: PropTypes.bool,
isChartingActive: PropTypes.bool,
diff --git a/web/js/containers/toolbar.test.js b/web/js/containers/toolbar.test.js
index 6d19e2a7b..27de7dce6 100644
--- a/web/js/containers/toolbar.test.js
+++ b/web/js/containers/toolbar.test.js
@@ -103,7 +103,6 @@ const {
const { clearCustomsSnapshot, refreshPalettes } = require('../modules/palettes/actions');
const { clearRotate, refreshRotation } = require('../modules/map/actions');
const { showLayers, hideLayers } = require('../modules/layers/actions');
-const { hasCustomPaletteInActiveProjection } = require('../modules/palettes/util');
const { isLocationSearchFeatureEnabled } = require('../modules/location-search/util');
const { getAllActiveLayers } = require('../modules/layers/selectors');
const { hasNonDownloadableVisibleLayer, getNonDownloadableLayers } = require('../modules/image-download/util');
@@ -298,14 +297,16 @@ describe('snapshot workflow (openImageDownload)', () => {
await act(async () => {
fireEvent.click(container.querySelector('#wv-image-button'));
});
- expect(notify).toHaveBeenCalledTimes(3);
- expect(notify).toHaveBeenCalledWith('palette', clearCustomsSnapshot, [{ id: 'vl' }]);
+ expect(notify).toHaveBeenCalledTimes(2);
expect(notify).toHaveBeenCalledWith('rotate', clearRotate, [{ id: 'vl' }]);
expect(notify).toHaveBeenCalledWith('layers', hideLayers, [{ id: 'vl' }]);
- const { onClose } = openModal.mock.calls.at(-1)[1];
+ let onClose;
+ await waitFor(() => {
+ ({ onClose } = openModal.mock.calls.at(-1)[1]);
+ });
onClose();
expect(refreshStateAfterImageDownload).toHaveBeenCalledWith(
- activePalettes, 45, [{ id: 'bad-layer' }],
+ undefined, 45, [{ id: 'bad-layer' }],
);
});
});
@@ -410,7 +411,6 @@ describe('mapStateToProps', () => {
expect(result.shouldBeCollapsed).toBe(false);
expect(getAllActiveLayers).toHaveBeenCalled();
expect(hasNonDownloadableVisibleLayer).toHaveBeenCalled();
- expect(hasCustomPaletteInActiveProjection).toHaveBeenCalled();
});
it('uses 2x icons on mobile', () => {
@@ -513,7 +513,7 @@ describe('mapDispatchToProps', () => {
it('notify uses the non-downloadable layer warning for layer type', () => {
props.notify('layers', hideLayers, [{ id: 'vl' }]);
const { bodyComponentProps } = openCustomContent.mock.calls.at(-1)[1];
- expect(getNonDownloadableLayers).toHaveBeenCalledWith([{ id: 'vl' }]);
+ expect(getNonDownloadableLayers).toHaveBeenCalledWith([{ id: 'vl' }], true);
expect(bodyComponentProps.bodyText).toBe('non-downloadable-warning');
bodyComponentProps.accept();
expect(hideLayers).toHaveBeenCalledWith([{ id: 'bad-layer' }]);
diff --git a/web/js/map/layerbuilder.js b/web/js/map/layerbuilder.js
index fa0455e60..23918f8b5 100644
--- a/web/js/map/layerbuilder.js
+++ b/web/js/map/layerbuilder.js
@@ -32,7 +32,7 @@ import {
getGeographicResolutionWMS,
mergeBreakpointLayerAttributes,
} from './util';
-import { fetchSubdailyDateRanges, datesInDateRanges, prevDateInDateRange } from '../modules/layers/util';
+import { fetchSubdailyDateRanges, datesInDateRanges, prevDateInDateRange, nearestInterval } from '../modules/layers/util';
import { getSelectedDate } from '../modules/date/selectors';
import {
isActive as isPaletteActive,
@@ -44,7 +44,6 @@ import {
getKey as getVectorStyleKeys,
applyStyle,
} from '../modules/vector-styles/selectors';
-import { nearestInterval } from '../modules/layers/util';
import {
LEFT_WING_EXTENT, RIGHT_WING_EXTENT, LEFT_WING_ORIGIN, RIGHT_WING_ORIGIN, CENTER_MAP_ORIGIN,
} from '../modules/map/constants';
@@ -89,6 +88,7 @@ export default function mapLayerBuilder(config, cache, store) {
layerPrior.wv = attributes;
layerNext.wv = attributes;
return new OlLayerGroup({
+ className: `wv-layer-group-${def.id}`,
layers: [layer, layerNext, layerPrior],
});
};
@@ -305,7 +305,9 @@ export default function mapLayerBuilder(config, cache, store) {
const projectionURL = `images/map/bluemarble-${id}.jpg`;
const layer = new ImageLayer({
+ className: `wv-layer-static-${id}`,
source: new Static({
+ interpolate: false,
url: projectionURL,
projection: crs,
imageExtent: maxExtent,
@@ -468,6 +470,7 @@ export default function mapLayerBuilder(config, cache, store) {
const sizes = !tileMatrices
? []
: tileMatrices.map(({ matrixWidth, matrixHeight }) => [matrixWidth, matrixHeight]);
+ const calcMatrixIds = matrixIds || resolutions.map((set, index) => index);
// Also need to shift this if granule is shifted
const tileGridOptions = {
@@ -475,7 +478,7 @@ export default function mapLayerBuilder(config, cache, store) {
extent: shifted ? RIGHT_WING_EXTENT : extent,
sizes,
resolutions,
- matrixIds: matrixIds || resolutions.map((set, index) => index),
+ matrixIds: calcMatrixIds,
tileSize: tileSize[0],
};
@@ -483,17 +486,19 @@ export default function mapLayerBuilder(config, cache, store) {
// This is to compensate for the inability to select seconds in the timeline
layerDate = new Date(layerDate.getTime());
layerDate.setSeconds(59);
+ const tileGrid = new OlTileGridWMTS(tileGridOptions);
const urlParameters = `?TIME=${util.toISOStringSeconds(layerDate, !isSubdaily)}`;
const sourceURL = def.sourceOverride || configSource.url;
const sourceOptions = {
- url: sourceURL + urlParameters,
+ interpolate: false,
+ url: `${sourceURL}${urlParameters}`,
layer: layer || id,
cacheSize: 4096,
crossOrigin: 'anonymous',
format,
transition: isGranule ? 350 : 0,
matrixSet: configMatrixSet.id,
- tileGrid: new OlTileGridWMTS(tileGridOptions),
+ tileGrid,
wrapX: false,
style: typeof style === 'undefined' ? 'default' : style,
};
@@ -504,6 +509,7 @@ export default function mapLayerBuilder(config, cache, store) {
const tileSource = new OlSourceWMTS(sourceOptions);
const layerTile = new OlLayerTile({
+ className: `wv-layer-${id}`,
preload: 0,
source: tileSource,
});
@@ -580,6 +586,7 @@ export default function mapLayerBuilder(config, cache, store) {
urlParameters = `?TIME=${util.toISOStringSeconds(util.roundTimeOneMinute(date), !isSubdaily)}`;
const sourceOptions = {
+ interpolate: false,
url: source.url + urlParameters,
cacheSize: 4096,
wrapX: true,
@@ -601,6 +608,7 @@ export default function mapLayerBuilder(config, cache, store) {
const tileSource = new OlSourceTileWMS(sourceOptions);
const layer = new OlLayerTile({
+ className: `wv-layer-${def.id}`,
preload: 0,
extent,
...!!resolutionBreakPoint && { minResolution: resolutionBreakPoint },
@@ -758,6 +766,7 @@ export default function mapLayerBuilder(config, cache, store) {
}
const layer = new OlLayerVector({
+ className: `wv-layer-${def.id}`,
extent: layerExtent,
source: vectorSource,
style (feature, resolution) {
@@ -926,6 +935,7 @@ export default function mapLayerBuilder(config, cache, store) {
};
const layer = new LayerVectorTile({
+ className: `wv-layer-${def.id}`,
renderOrder: orderFunction,
extent: layerExtent,
source: tileSource,
@@ -943,6 +953,7 @@ export default function mapLayerBuilder(config, cache, store) {
const newDef = { ...def, ...breakPointLayerDef };
const wmsLayer = createLayerWMS(newDef, options, day, state);
const layerGroup = new OlLayerGroup({
+ className: `wv-layer-group-${def.id}`,
layers: [layer, wmsLayer],
});
wmsLayer.wv = attributes;
@@ -1057,6 +1068,7 @@ export default function mapLayerBuilder(config, cache, store) {
};
const xyzSourceOptions = {
+ interpolate: false,
crossOrigin: 'anonymous',
projection: get(crs),
tileUrlFunction,
@@ -1079,6 +1091,7 @@ export default function mapLayerBuilder(config, cache, store) {
maxZoom: def.minZoom,
});
const layerGroup = new OlLayerGroup({
+ className: `wv-layer-group-${def.id}`,
layers: [footprintLayer, layer],
});
@@ -1102,6 +1115,7 @@ export default function mapLayerBuilder(config, cache, store) {
};
const xyzSourceOptions = {
+ interpolate: false,
crossOrigin: 'anonymous',
projection: get(crs),
tileUrlFunction,
@@ -1239,6 +1253,7 @@ export default function mapLayerBuilder(config, cache, store) {
const isMaxarSource = source === 'MAXAR:wmts';
const sourceOptions = {
+ interpolate: false,
url: `${baseUrl}/{z}/{x}/{y}`,
layer: layerName,
crossOrigin: 'anonymous',
@@ -1339,7 +1354,10 @@ export default function mapLayerBuilder(config, cache, store) {
extent: shifted ? RIGHT_WING_EXTENT : extent,
});
});
- const layer = new OlLayerGroup({ layers });
+ const layer = new OlLayerGroup({
+ className: `wv-layer-group-${def.id}`,
+ layers,
+ });
return layer;
};
diff --git a/web/js/map/natural-events/event-markers.js b/web/js/map/natural-events/event-markers.js
index d6d4073a5..bb9114982 100644
--- a/web/js/map/natural-events/event-markers.js
+++ b/web/js/map/natural-events/event-markers.js
@@ -44,6 +44,7 @@ const createPin = function(id, category, isSelected, title, hideTooltip) {
title,
id,
hideTooltip,
+ withPin: true,
}),
);
return new OlOverlay({
diff --git a/web/js/map/natural-events/event-track.js b/web/js/map/natural-events/event-track.js
index 6dfda0696..9bf25caa5 100644
--- a/web/js/map/natural-events/event-track.js
+++ b/web/js/map/natural-events/event-track.js
@@ -157,6 +157,7 @@ function EventTrack () {
const [trackDetails, setTrackDetails] = useState({});
const [allTrackDetails, setAllTrackDetails] = useState([]);
+ const [mapMoves, setMapMoves] = useState(0);
const trackDetailsRef = useRef();
trackDetailsRef.current = trackDetails;
const allTrackDetailsRef = useRef();
@@ -165,6 +166,7 @@ function EventTrack () {
const mapRef = useRef(map);
useEffect(() => {
mapRef.current = map;
+ map?.on?.('moveend', () => setMapMoves((c) => c + 1));
}, [map]);
useEffect(() => {
showAllTracksRef.current = showAllTracks;
@@ -445,7 +447,7 @@ function EventTrack () {
}
},
[map, isPlaying, extent, selectedDate, isAnimatingToEvent, eventsData, selectedEvent,
- showAllTracksRef.current, highlightedEvent, showAllTracks],
+ showAllTracksRef.current, highlightedEvent, showAllTracks, mapMoves],
);
return null;
diff --git a/web/js/mapUI/components/create-map/createMap.js b/web/js/mapUI/components/create-map/createMap.js
index dac35fca5..6849d90b8 100644
--- a/web/js/mapUI/components/create-map/createMap.js
+++ b/web/js/mapUI/components/create-map/createMap.js
@@ -135,7 +135,7 @@ function CreateMap(props) {
],
loadTilesWhileAnimating: true,
loadTilesWhileInteracting: true,
- maxTilesLoading: 32,
+ maxTilesLoading: Number.MAX_SAFE_INTEGER,
});
map.wv = {
scaleMetric,
diff --git a/web/js/mapUI/components/create-map/createMap.test.js b/web/js/mapUI/components/create-map/createMap.test.js
index 592ae0aba..e8561c44f 100644
--- a/web/js/mapUI/components/create-map/createMap.test.js
+++ b/web/js/mapUI/components/create-map/createMap.test.js
@@ -334,11 +334,11 @@ describe('CreateMap', () => {
expect(mapConfig.loadTilesWhileInteracting).toBe(true);
});
- it('sets maxTilesLoading to 32', () => {
+ it('sets maxTilesLoading to Number.MAX_SAFE_INTEGER', () => {
const { props } = buildDefaultProps();
renderComponent(props);
const mapConfig = OlMap.mock.calls[0][0];
- expect(mapConfig.maxTilesLoading).toBe(32);
+ expect(mapConfig.maxTilesLoading).toBe(Number.MAX_SAFE_INTEGER);
});
it('sets map.wv with scaleMetric and scaleImperial', () => {
diff --git a/web/js/mapUI/mapUI.js b/web/js/mapUI/mapUI.js
index 12ce79d35..f7d3e6cc8 100644
--- a/web/js/mapUI/mapUI.js
+++ b/web/js/mapUI/mapUI.js
@@ -100,8 +100,7 @@ function MapUI(props) {
const [vectorActions, setVectorActions] = useState({});
const [preloadAction, setPreloadAction] = useState({});
- // eslint-disable-next-line no-unused-vars
- const [devTestMode, setDevTestMode] = useState(false);
+ const devTestMode = false;
const subscribeToStore = function(action) {
switch (action.type) {
diff --git a/web/js/modules/gif-download/constants.js b/web/js/modules/gif-download/constants.js
new file mode 100644
index 000000000..61dbfc7f7
--- /dev/null
+++ b/web/js/modules/gif-download/constants.js
@@ -0,0 +1,21 @@
+export const RESOLUTIONS_GEO = {
+ values: [
+ { value: '0.125', text: '30m' },
+ { value: '0.25', text: '60m' },
+ { value: '0.5', text: '125m' },
+ { value: '1', text: '250m' },
+ { value: '2', text: '500m' },
+ { value: '4', text: '1km' },
+ { value: '20', text: '5km' },
+ { value: '40', text: '10km' },
+ ],
+};
+export const RESOLUTIONS_POLAR = {
+ values: [
+ { value: '1', text: '250m' },
+ { value: '2', text: '500m' },
+ { value: '4', text: '1km' },
+ { value: '20', text: '5km' },
+ { value: '40', text: '10km' },
+ ],
+};
diff --git a/web/js/modules/gif-download/util.js b/web/js/modules/gif-download/util.js
new file mode 100644
index 000000000..522342b45
--- /dev/null
+++ b/web/js/modules/gif-download/util.js
@@ -0,0 +1,100 @@
+const GEO_ESTIMATION_CONSTANT = 256.0;
+const POLAR_ESTIMATION_CONSTANT = 0.002197265625;
+
+export function imageUtilGetConversionFactor(proj) {
+ if (proj === 'geographic') return POLAR_ESTIMATION_CONSTANT;
+ return GEO_ESTIMATION_CONSTANT;
+}
+
+export function imageUtilEstimateResolution(resolution, isGeoProjection) {
+ return isGeoProjection
+ ? resolution / POLAR_ESTIMATION_CONSTANT
+ : resolution / GEO_ESTIMATION_CONSTANT;
+}
+
+export function imageUtilCalculateResolution(
+ zoom,
+ isGeoProjection,
+ resolutions,
+) {
+ let resolution;
+ const nZoomLevels = resolutions.length;
+ const currentZoom = zoom < 0 ? 0 : zoom;
+ const curResolution = currentZoom >= nZoomLevels
+ ? resolutions[nZoomLevels - 1]
+ : resolutions[currentZoom];
+
+ // Estimate the option value used by "wv-image-resolution"
+ const resolutionEstimate = imageUtilEstimateResolution(
+ curResolution,
+ isGeoProjection,
+ );
+
+ // Find the closest match of resolution within the available values
+ const possibleResolutions = isGeoProjection
+ ? [0.125, 0.25, 0.5, 1, 2, 4, 20, 40]
+ : [1, 2, 4, 20, 40];
+ let bestDiff = Infinity;
+ let bestIdx = -1;
+ let currDiff = 0;
+ for (let i = 0; i < possibleResolutions.length; i += 1) {
+ currDiff = Math.abs(possibleResolutions[i] - resolutionEstimate);
+ if (currDiff < bestDiff) {
+ resolution = possibleResolutions[i];
+ bestDiff = currDiff;
+ bestIdx = i;
+ }
+ }
+ // Bump up resolution in certain cases where default is too low
+ if (bestIdx > 0) {
+ if (isGeoProjection) {
+ switch (currentZoom) {
+ case 3:
+ case 4:
+ case 6:
+ case 7:
+ resolution = possibleResolutions[bestIdx - 1];
+ break;
+ default:
+ break;
+ }
+ } else {
+ switch (currentZoom) {
+ case 1:
+ case 2:
+ case 4:
+ case 5:
+ resolution = possibleResolutions[bestIdx - 1];
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ return resolution.toString();
+}
+
+export function imageUtilGetCoordsFromPixelValues(pixels, map) {
+ const {
+ x, y, x2, y2,
+ } = pixels;
+ return [
+ map.getCoordinateFromPixel([Math.floor(x), Math.floor(y2)]),
+ map.getCoordinateFromPixel([Math.floor(x2), Math.floor(y)]),
+ ];
+}
+
+export function getDimensions(projection, bounds, resolution) {
+ const conversionFactor = imageUtilGetConversionFactor(projection);
+ const imgWidth = Math.round(
+ Math.abs(bounds[1][0] - bounds[0][0]) /
+ conversionFactor /
+ Number(resolution),
+ );
+ const imgHeight = Math.round(
+ Math.abs(bounds[1][1] - bounds[0][1]) /
+ conversionFactor /
+ Number(resolution),
+ );
+ return { width: imgWidth, height: imgHeight };
+}
diff --git a/web/js/modules/gif-download/util.test.js b/web/js/modules/gif-download/util.test.js
new file mode 100644
index 000000000..0a70a768f
--- /dev/null
+++ b/web/js/modules/gif-download/util.test.js
@@ -0,0 +1,24 @@
+import {
+ imageUtilCalculateResolution,
+} from './util';
+
+const geoResolutions = [
+ 0.5625,
+ 0.28125,
+ 0.140625,
+ 0.0703125,
+ 0.03515625,
+ 0.017578125,
+ 0.0087890625,
+ 0.00439453125,
+ 0.002197265625,
+ 0.0010986328125,
+ 0.00054931640625,
+ 0.00027465820313,
+];
+
+test('Default km resolution Calculation [imagedownload-default-resolution]', () => {
+ const zoom = 5;
+ const isGeo = true;
+ expect(imageUtilCalculateResolution(zoom, isGeo, geoResolutions)).toBe('4');
+});
diff --git a/web/js/modules/image-download/actions.js b/web/js/modules/image-download/actions.js
index ad11d9819..1eb701987 100644
--- a/web/js/modules/image-download/actions.js
+++ b/web/js/modules/image-download/actions.js
@@ -3,6 +3,7 @@ import {
UPDATE_FILE_TYPE,
UPDATE_RESOLUTION,
UPDATE_WORLDFILE,
+ UPDATE_IN_PROGRESS,
} from './constants';
export function updateBoundaries(obj) {
@@ -23,3 +24,9 @@ export function onPanelChange(type, value) {
value,
};
}
+export function updateInProgress(obj) {
+ return {
+ type: UPDATE_IN_PROGRESS,
+ inProgress: obj,
+ };
+}
diff --git a/web/js/modules/image-download/constants.js b/web/js/modules/image-download/constants.js
index e040bed2c..00f1f33bc 100644
--- a/web/js/modules/image-download/constants.js
+++ b/web/js/modules/image-download/constants.js
@@ -2,26 +2,29 @@ export const UPDATE_BOUNDARIES = 'IMAGE-DOWNLOAD/UPDATE_BOUNDARIES';
export const UPDATE_FILE_TYPE = 'IMAGE-DOWNLOAD/UPDATE_FILE_TYPE';
export const UPDATE_WORLDFILE = 'IMAGE-DOWNLOAD/UPDATE_WORLDFILE';
export const UPDATE_RESOLUTION = 'IMAGE-DOWNLOAD/UPDATE_RESOLUTION';
+export const UPDATE_IN_PROGRESS = 'IMAGE-DOWNLOAD/UPDATE_IN_PROGRESS';
-export const resolutionsGeo = {
+export const RESOLUTIONS_GEO = {
values: [
- { value: '0.125', text: '30m' },
- { value: '0.25', text: '60m' },
- { value: '0.5', text: '125m' },
- { value: '1', text: '250m' },
- { value: '2', text: '500m' },
- { value: '4', text: '1km' },
- { value: '20', text: '5km' },
- { value: '40', text: '10km' },
+ { value: 0.075, text: '0.075m' },
+ { value: 0.3, text: '0.3m' },
+ { value: 30, text: '30m', tileMatrixID: 11 },
+ { value: 60, text: '60m', tileMatrixID: 10 },
+ { value: 125, text: '125m', tileMatrixID: 9 },
+ { value: 250, text: '250m', tileMatrixID: 8 },
+ { value: 500, text: '500m', tileMatrixID: 7 },
+ { value: 1000, text: '1km', tileMatrixID: 6 },
+ { value: 5000, text: '5km', tileMatrixID: 5 },
+ { value: 10000, text: '10km', tileMatrixID: 4 },
],
};
-export const resolutionsPolar = {
+export const RESOLUTIONS_POLAR = {
values: [
- { value: '1', text: '250m' },
- { value: '2', text: '500m' },
- { value: '4', text: '1km' },
- { value: '20', text: '5km' },
- { value: '40', text: '10km' },
+ { value: 250, text: '250m', tileMatrixID: 5 },
+ { value: 500, text: '500m', tileMatrixID: 4 },
+ { value: 1000, text: '1km', tileMatrixID: 3 },
+ { value: 5000, text: '5km', tileMatrixID: 2 },
+ { value: 10000, text: '10km', tileMatrixID: 1 },
],
};
export const fileTypesGeo = {
@@ -52,3 +55,13 @@ export const notificationWarnings = {
palette: PALETTE_WARNING,
rotate: ROTATE_WARNING,
};
+
+export const GDAL_WASM_PATH = 'build/gdal3js';
+
+export const DRIVER_DICT = {
+ tiff: 'GTiff',
+ tif: 'GTiff',
+ jpg: 'JPEG',
+ jpeg: 'JPEG',
+ png: 'PNG',
+};
diff --git a/web/js/modules/image-download/reducers.js b/web/js/modules/image-download/reducers.js
index cb4002115..e4e6cfbf0 100644
--- a/web/js/modules/image-download/reducers.js
+++ b/web/js/modules/image-download/reducers.js
@@ -4,6 +4,7 @@ import {
UPDATE_FILE_TYPE,
UPDATE_WORLDFILE,
UPDATE_RESOLUTION,
+ UPDATE_IN_PROGRESS,
fileTypesPolar,
} from './constants';
import { CHANGE_PROJECTION } from '../projection/constants';
@@ -12,7 +13,8 @@ export const defaultState = {
fileType: 'image/jpeg',
boundaries: undefined,
isWorldfile: false,
- resolution: '',
+ resolution: undefined,
+ inProgress: false,
};
export function imageDownloadReducer(state = defaultState, action) {
@@ -40,6 +42,10 @@ export function imageDownloadReducer(state = defaultState, action) {
: state.fileType;
return lodashAssign({}, defaultState, { fileType });
}
+ case UPDATE_IN_PROGRESS:
+ return lodashAssign({}, state, {
+ inProgress: action.inProgress,
+ });
default:
return state;
}
diff --git a/web/js/modules/image-download/util.js b/web/js/modules/image-download/util.js
index d2fb94d03..dd7c4e897 100644
--- a/web/js/modules/image-download/util.js
+++ b/web/js/modules/image-download/util.js
@@ -1,11 +1,25 @@
+/* eslint no-underscore-dangle: 0 */
+import html2canvas from 'html2canvas';
import {
get as lodashGet,
} from 'lodash';
-import { transform } from 'ol/proj';
+import JSZip from 'jszip';
+import canvasSize from 'canvas-size';
+import { evaluate } from 'mathjs';
+import { transform, get } from 'ol/proj';
+import * as olExtent from 'ol/extent';
+import olTileState from 'ol/TileState';
+import initGdalJs from 'gdal3.js';
import util from '../../util/util';
import { formatDisplayDate } from '../date/util';
import { nearestInterval } from '../layers/util';
import { CRS } from '../map/constants';
+import {
+ GDAL_WASM_PATH,
+ DRIVER_DICT,
+ RESOLUTIONS_GEO,
+ RESOLUTIONS_POLAR,
+} from './constants';
const GEO_ESTIMATION_CONSTANT = 256.0;
const POLAR_ESTIMATION_CONSTANT = 0.002197265625;
@@ -43,7 +57,7 @@ export function getLatestIntervalTime(layerDefs, dateTime) {
* @param {Array} opacities
* @returns {Object} layersArray, layerWraps, opacities
*/
-const imageUtilProcessKMZOrbitTracks = function(layersArray, layerWraps, opacities) {
+const imageUtilProcessKMZOrbitTracks = (layersArray, layerWraps, opacities) => {
const processedLayersArray = [...layersArray];
const processedLayerWraps = [...layerWraps];
const processedOpacities = [...opacities];
@@ -86,7 +100,7 @@ const imageUtilProcessKMZOrbitTracks = function(layersArray, layerWraps, opaciti
* @param {Array} opacities
* @returns {Object} layersArray, layerWraps, opacities
*/
-const imageUtilProcessWrap = function(fileType, layersArray, layerWraps, opacities) {
+const imageUtilProcessWrap = (fileType, layersArray, layerWraps, opacities) => {
if (fileType === 'application/vnd.google-earth.kmz') {
return imageUtilProcessKMZOrbitTracks(layersArray, layerWraps, opacities);
}
@@ -103,6 +117,21 @@ export function imageUtilEstimateResolution(resolution, isGeoProjection) {
: resolution / GEO_ESTIMATION_CONSTANT;
}
+function getMetersPerUnit(projection, center = [0, 0]) {
+ const units = projection.getUnits();
+ let metersPerUnit = projection.getMetersPerUnit();
+
+ if (units === 'degrees') metersPerUnit *= evaluate(`cos((${center[1]} * pi) / ${180})`);
+
+ return metersPerUnit;
+}
+
+function convertResolutionToMetersPerPixel(resolution, projection, center = [0, 0]) {
+ const metersPerUnit = getMetersPerUnit(projection, center);
+
+ return evaluate(`${resolution} * ${metersPerUnit}`);
+}
+
/*
* Estimate appropriate Resolution based on zoom
* This is only run if user has not already selected
@@ -110,31 +139,36 @@ export function imageUtilEstimateResolution(resolution, isGeoProjection) {
*/
export function imageUtilCalculateResolution(
zoom,
- isGeoProjection,
- resolutions,
+ proj,
+ center,
) {
let resolution;
+ const isGeoProjection = proj.id === 'geographic';
+ const { crs, resolutions } = proj.selected || proj;
+ const projection = get(crs);
const nZoomLevels = resolutions.length;
const currentZoom = zoom < 0 ? 0 : zoom;
const curResolution = currentZoom >= nZoomLevels
? resolutions[nZoomLevels - 1]
: resolutions[currentZoom];
- // Estimate the option value used by "wv-image-resolution"
- const resolutionEstimate = imageUtilEstimateResolution(
+ const currResolutionInMeters = convertResolutionToMetersPerPixel(
curResolution,
- isGeoProjection,
+ projection,
+ center,
);
+ const getResolutions = (config) => config.values.map((res) => res.value);
+
// Find the closest match of resolution within the available values
const possibleResolutions = isGeoProjection
- ? [0.125, 0.25, 0.5, 1, 2, 4, 20, 40]
- : [1, 2, 4, 20, 40];
+ ? getResolutions(RESOLUTIONS_GEO)
+ : getResolutions(RESOLUTIONS_POLAR);
let bestDiff = Infinity;
let bestIdx = -1;
let currDiff = 0;
for (let i = 0; i < possibleResolutions.length; i += 1) {
- currDiff = Math.abs(possibleResolutions[i] - resolutionEstimate);
+ currDiff = Math.abs(possibleResolutions[i] - currResolutionInMeters);
if (currDiff < bestDiff) {
resolution = possibleResolutions[i];
bestDiff = currDiff;
@@ -168,7 +202,7 @@ export function imageUtilCalculateResolution(
}
}
}
- return resolution.toString();
+ return resolution;
}
/*
@@ -301,6 +335,40 @@ export function getTruncatedGranuleDates(layerDefs) {
});
}
+/**
+ * Calculate ground resolution from map state and target spatial resolution
+ * @param {Number} targetMetersPerPixel - Target spatial resolution in meters per pixel
+ * @param {Object} projection - Map projection
+ * @param {Number} mapResolution - Current map resolution
+ * @param {Array} center - Map center coordinates
+ * @returns {Number} - Scale factor to apply to map
+ */
+function calculateScaleFactor(targetMetersPerPixel, projection, mapResolution, center) {
+ const currentResolutionInMeters = convertResolutionToMetersPerPixel(
+ mapResolution,
+ projection,
+ center,
+ );
+
+ // Calculate scale factor needed to achieve target resolution
+ return evaluate(`${currentResolutionInMeters} / ${targetMetersPerPixel}`);
+}
+
+export const estimateMaxCanvasSize = () => canvasSize.maxArea();
+
+export async function estimateMaxImageSize() {
+ const { height: maxHeight, width: maxWidth } = await estimateMaxCanvasSize();
+
+ const devicePixelRatio = window.devicePixelRatio || 1;
+ const aoiMaxHeight = maxHeight / devicePixelRatio;
+ const aoiMaxWidth = maxWidth / devicePixelRatio;
+
+ return {
+ height: Math.floor(aoiMaxHeight),
+ width: Math.floor(aoiMaxWidth),
+ };
+}
+
/**
* Get the snapshots URL to download an image
* @param {String} url
@@ -370,7 +438,6 @@ export function getDownloadUrl(
if (markerCoordinates.length > 0) {
const coords = markerCoordinates.reduce((validCoords, { longitude: lon, latitude: lat }) => {
const mCoord = transform([lon, lat], CRS.GEOGRAPHIC, crs);
- // const inExtent = containsCoordinate(boundingExtent(bbox), mCoord);
return validCoords.concat([mCoord[0], mCoord[1]]);
}, []);
params.push(`MARKER=${coords.join(',')}`);
@@ -378,6 +445,613 @@ export function getDownloadUrl(
return `${url}?${params.join('&')}&ts=${Date.now()}`;
}
+/**
+ * Convert a PNG image to a georeferenced KML file
+ * @param {Blob} pngBlob - The input PNG Blob
+ * @param {Object} options - Additional options for georeferencing
+ * @param {Array} options.extent - Bounding box [minX, minY, maxX, maxY] in map units
+ * @param {String} options.crs - The Coordinate Reference System identifier (e.g., 'EPSG:4326')
+ * @param {String} options.name - Optional name for the KML overlay (default: 'Image Overlay')
+ * @param {String} options.description - Optional description for the KML overlay
+ * @returns {Promise<Blob>} - A promise that resolves to the KML Blob
+ */
+export function convertPngToKml(pngBlob, options) {
+ return new Promise((resolve, reject) => {
+ try {
+ // Validate input
+ if (!(pngBlob instanceof Blob)) {
+ reject(new Error('Input must be a Blob'));
+ return;
+ }
+
+ // KML requires coordinates in EPSG:4326 (WGS84)
+ if (options.crs !== 'EPSG:4326') {
+ reject(new Error('KML requires WGS84 coordinates'));
+ return;
+ }
+
+ const reader = new FileReader();
+
+ reader.onload = () => {
+ try {
+ // Extract the base64 part of the data URL
+ const dataUrl = reader.result;
+ const base64Data = dataUrl.split(',')[1];
+
+ const [minX, minY, maxX, maxY] = options.extent;
+
+ // Create the KML document
+ const kmlContent = `<?xml version="1.0" encoding="UTF-8"?>
+ <kml xmlns="http://www.opengis.net/kml/2.2">
+ <Document>
+ <name>${options.name || 'Image Overlay'}</name>
+ <GroundOverlay>
+ <name>${options.name || 'Image Overlay'}</name>
+ ${options.description ? `<description>${options.description}</description>` : ''}
+ <Icon>
+ <href>data:image/png;base64,${base64Data}</href>
+ </Icon>
+ <LatLonBox>
+ <north>${maxY}</north>
+ <south>${minY}</south>
+ <east>${maxX}</east>
+ <west>${minX}</west>
+ <rotation>0</rotation>
+ </LatLonBox>
+ </GroundOverlay>
+ </Document>
+ </kml>`;
+ // Create the KML Blob
+ const kmlBlob = new Blob([kmlContent], { type: 'application/vnd.google-earth.kml+xml' });
+ resolve(kmlBlob);
+ } catch (error) {
+ console.error('Error creating KML content:', error);
+ reject(error);
+ }
+ };
+
+ reader.onerror = () => reject(new Error('Failed to read image data'));
+
+ reader.readAsDataURL(pngBlob);
+ } catch (error) {
+ console.error('Error creating KML:', error);
+ reject(error);
+ }
+ });
+}
+
+/**
+ * Convert a input Blob to a properly georeferenced GeoTIFF Blob
+ * @param {Blob} pngBlob - The input TIFF Blob
+ * @param {Object} options - Additional options for georeferencing
+ * @param {Array} options.extent - Bounding box [minX, minY, maxX, maxY] in map units
+ * @param {String} options.crs - The Coordinate Reference System identifier (e.g., 'EPSG:4326')
+ * @param {Number} options.metersPerPixel - Ground resolution in meters per pixel
+ * @param {Number} options.captureWidth - Width of the output image in pixels
+ * @param {Number} options.captureHeight - Height of the output image in pixels
+ * @param {String} options.inputFormat - Input image format (default: 'png')
+ * @param {String} options.outputFormat - Output image format (default: 'tif')
+ * @param {Boolean} options.worldfile - Whether to create a worldfile
+ * @param {String} options.name - Optional name for the output file
+ * @param {String} options.description - Optional description for the output file
+ * @returns {Promise<Blob>} - A promise that resolves to the GeoTIFF Blob
+ */
+export async function georeference (inputBlob, options) {
+ let {
+ outputFormat = 'tif',
+ } = options;
+ const {
+ inputFormat = 'png',
+ crs = 'EPSG:4326',
+ captureHeight,
+ captureWidth,
+ } = options;
+ // Normalize tiff to tif for consistency
+ if (outputFormat === 'tiff' || outputFormat === 'geotiff') outputFormat = 'tif';
+ // Normalize jpg to jpeg for consistency
+ if (outputFormat === 'jpeg') outputFormat = 'jpg';
+ if (outputFormat === 'kml') {
+ const blob = await convertPngToKml(inputBlob, options);
+
+ return [
+ {
+ name: 'image.kml',
+ blob,
+ },
+ ];
+ }
+ const worldfile = options.worldfile ? 'YES' : 'NO';
+
+ const file = new File([inputBlob], `image.${inputFormat}`, { type: `image/${inputFormat}` });
+ const gdal = await initGdalJs({ path: GDAL_WASM_PATH, useWorker: true });
+ const openResult = await gdal.open(file);
+ const dataset = openResult.datasets[0];
+
+ const width = captureWidth || dataset.info.size[0];
+ const height = captureHeight || dataset.info.size[1];
+ const extent = options.extent.map((coord) => `${coord}`);
+ const driver = DRIVER_DICT[outputFormat];
+
+ const translateOpts = [
+ '-strict',
+ '-of', driver, // Output format
+ '-a_srs', crs, // Set the spatial reference system
+ '-outsize', `${width}`, `${height}`, // Set the output size
+ '-r', 'average', // Resampling method
+ '-a_ullr', extent[0], extent[3], extent[2], extent[1], // Set the bounding box
+ ];
+ if (driver !== 'GTiff') {
+ translateOpts.push('-co', `WORLDFILE=${worldfile}`); // Create a world file if requested
+ } else {
+ translateOpts.push('-co', `TFW=${worldfile}`); // Create ESRI tfw file
+ }
+
+ // For JPEG output, ensure RGB color space by selecting
+ // only RGB bands and setting color interpretation
+ if (driver === 'JPEG') {
+ const jpegOpts = [
+ '-co', 'QUALITY=75', // Maximum quality
+ '-b', '1', '-b', '2', '-b', '3', // Select only RGB bands, drop alpha
+ '-colorinterp', 'red,green,blue', // RGB color interpretation
+ ];
+ translateOpts.push(...jpegOpts);
+ }
+
+ const translate = await gdal.gdal_translate(dataset, translateOpts);
+
+ gdal.close(dataset);
+
+ const files = translate.all.map((p) => ({ path: p.local }));
+ const imageFilePath = files.find((f) => f.path.endsWith(`.${outputFormat}`))?.path;
+ const worldFilePath = files.find((f) => f.path.endsWith('.wld') || f.path.endsWith('.tfw'))?.path;
+ const imageFileBytes = await gdal.getFileBytes(imageFilePath);
+ const imageFileName = imageFilePath.split('/').pop();
+ const imageFileBlob = new Blob([imageFileBytes]);
+ const output = [
+ {
+ name: imageFileName,
+ blob: imageFileBlob,
+ },
+ ];
+ if (worldFilePath) {
+ const worldfileBytes = await gdal.getFileBytes(worldFilePath);
+ const worldFileName = worldFilePath.split('/').pop();
+ const worldFileBlob = new Blob([worldfileBytes], { type: 'text/plain' });
+ output.push({
+ name: worldFileName,
+ blob: worldFileBlob,
+ });
+ }
+
+ return output;
+}
+
+/**
+ * Update high-resolution tile grids for a specific layer
+ * @param {*} layer - The OpenLayers layer to update
+ * @returns {Function} - A function to restore the original tile grids
+ */
+function updateHighResTileGrids(layer, abortSignal, tileMatrixID = -1, onerror) {
+ const originalSource = layer.getSource();
+ // No tile grid to update
+ if (typeof originalSource?.getTileGrid !== 'function') return () => null;
+ const SourceConstructor = originalSource.constructor;
+ const originalTileGrid = originalSource.getTileGrid();
+ const TileGridConstructor = originalTileGrid.constructor;
+ const resolutions = originalTileGrid.getResolutions();
+ // No matrix IDs to update
+ if (typeof originalTileGrid.getMatrixIds !== 'function') return () => null;
+ const matrixIds = originalTileGrid.getMatrixIds?.();
+ const maxResolutions = resolutions.slice(0, tileMatrixID + 1);
+ const maxMatrixIds = matrixIds ? matrixIds.slice(0, tileMatrixID + 1) : undefined;
+
+ const tileGrid = new TileGridConstructor({
+ ...originalTileGrid,
+ origin: originalTileGrid.getOrigin?.() || originalTileGrid.origin_,
+ extent: originalTileGrid.getExtent?.() || originalTileGrid.extent_,
+ resolutions: maxResolutions,
+ matrixIds: maxMatrixIds,
+ tileSize: originalTileGrid.getTileSize?.() || originalTileGrid.tileSize_,
+ minZoom: tileMatrixID,
+ maxZoom: tileMatrixID,
+ });
+
+ const originalTileLoadFunction = originalSource.getTileLoadFunction?.() ||
+ originalSource.tileLoadFunction_;
+
+ const cancellableTileLoadFunction = async (tile, src) => {
+ if (tile.getState() === 2) return;
+ try {
+ tile.setState(olTileState.LOADING);
+ const response = await fetch(src, { signal: abortSignal });
+ const blob = await response.blob();
+ const imageUrl = URL.createObjectURL(blob);
+ await originalTileLoadFunction(tile, imageUrl);
+ URL.revokeObjectURL(imageUrl);
+ } catch (error) {
+ if (error.name === 'AbortError') return;
+ tile.setState(olTileState.ERROR);
+ onerror();
+ }
+ };
+ const sourceOptions = {
+ ...originalSource,
+ urls: originalSource.getUrls?.() || originalSource.urls_,
+ format: originalSource.getFormat?.() || originalSource.format_,
+ projection: originalSource.getProjection?.() || originalSource.projection_,
+ tileGrid,
+ layer: originalSource.getLayer?.() || originalSource.layer_,
+ tileLoadFunction: cancellableTileLoadFunction,
+ matrixSet: originalSource.getMatrixSet?.() || originalSource.matrixSet_,
+ dimensions: originalSource.getDimensions?.() || originalSource.dimensions_,
+ crossOrigin: 'anonymous',
+ };
+
+ const hrSource = new SourceConstructor(sourceOptions);
+ layer.setSource(hrSource);
+
+ return () => layer.setSource(originalSource);
+}
+
+/**
+ * Toggle high-resolution tile grids for all layers in the map
+ * @param {Object} map - The OpenLayers map instance
+ * @returns {Function} - A function to restore the original tile grids
+ */
+function toggleHighResTileGrids (map, abortSignal, tileMatrixID, onerror) {
+ const layers = map.getAllLayers();
+ const restoreSources = layers
+ .filter((layer) => layer.getVisible())
+ .map((layer) => updateHighResTileGrids(layer, abortSignal, tileMatrixID, onerror));
+
+ return () => restoreSources.forEach((restoreSource) => restoreSource());
+}
+
+/**
+ * Create a restore function for the map and (optionally) configure high-resolution tile grids
+ * @param {Object} map
+ * @returns {Function} - A function to restore the original map state
+ */
+function createMapRestore(map, extent, abortSignal, tileMatrixID, onerror) {
+ const mapElement = map.getTargetElement();
+ const originalView = map.getView();
+ const ViewConstructor = originalView.constructor;
+ const newView = new ViewConstructor({
+ center: originalView.getCenter(),
+ resolution: originalView.getResolution(),
+ projection: originalView.getProjection(),
+ zoom: originalView.getZoom(),
+ rotation: originalView.getRotation(),
+ maxZoom: originalView.getMaxZoom(),
+ minZoom: originalView.getMinZoom(),
+ extent: extent || originalView.getExtent(),
+ maxResolution: originalView.getMaxResolution(),
+ minResolution: originalView.getMinResolution(),
+ resolutions: originalView.getResolutions(),
+ multiWorld: false,
+ showFullExtent: true,
+ smoothResolutionConstraint: false,
+ });
+ map.setView(newView);
+ const originalStyleWidth = mapElement.style.width;
+ const originalStyleHeight = mapElement.style.height;
+
+ const restoreLayers = toggleHighResTileGrids(map, abortSignal, tileMatrixID, onerror);
+
+ return () => {
+ // Restore original map size
+ restoreLayers();
+ map.setView(originalView);
+ mapElement.style.width = originalStyleWidth;
+ mapElement.style.height = originalStyleHeight;
+ map.updateSize();
+ };
+}
+
+/**
+ * Initiates a download and waits for a reasonable delay to simulate download completion
+ * @param {Blob} blob - The blob to download
+ * @param {String} filename - The filename for the download
+ * @param {AbortSignal} abortSignal - Optional abort signal
+ * @returns {Promise} - Resolves when download is initiated and delay is complete
+ */
+async function initiateDownload(blob, filename, abortSignal, parentReject) {
+ // Wait for download to initiate with cancellation support
+ return new Promise((resolve, reject) => {
+ const timeoutId = setTimeout(resolve, 0);
+
+ if (abortSignal) {
+ const abortHandler = () => {
+ clearTimeout(timeoutId);
+ reject(new DOMException('Snapshot operation was cancelled', 'AbortError'));
+ };
+
+ if (abortSignal.aborted) {
+ clearTimeout(timeoutId);
+ reject(new DOMException('Snapshot operation was cancelled', 'AbortError'));
+ return;
+ }
+
+ abortSignal.addEventListener('abort', abortHandler, { once: true });
+
+ const url = URL.createObjectURL(blob);
+ const link = document.createElement('a');
+ link.href = url;
+ link.download = filename;
+ link.click();
+ URL.revokeObjectURL(url);
+
+ // Clean up the event listener when the timeout completes
+ setTimeout(() => {
+ abortSignal.removeEventListener('abort', abortHandler);
+ }, 0);
+ }
+ });
+}
+
+function getExtentFromPixelBbox(pixelBbox, map) {
+ const [minPixelX, minPixelY, maxPixelX, maxPixelY] = pixelBbox;
+
+ // Calculate geographic extent
+ const topLeft = map.getCoordinateFromPixel([minPixelX, minPixelY]);
+ const topRight = map.getCoordinateFromPixel([maxPixelX, minPixelY]);
+ const bottomLeft = map.getCoordinateFromPixel([minPixelX, maxPixelY]);
+ const bottomRight = map.getCoordinateFromPixel([maxPixelX, maxPixelY]);
+
+ // Put everything in the correct order
+ const minX = Math.min(topLeft[0], bottomLeft[0]);
+ const maxX = Math.max(topRight[0], bottomRight[0]);
+ const minY = Math.min(bottomLeft[1], bottomRight[1]);
+ const maxY = Math.max(topLeft[1], topRight[1]);
+ const extent = [minX, minY, maxX, maxY];
+
+ return extent;
+}
+
+async function fitViewToExtent(map, extent) {
+ return new Promise((resolve) => {
+ const view = map.getView();
+ // the callback option in view.fit is called before the view is actually fitted in safari,
+ // so we need to wait for the render complete event
+ map.once('rendercomplete', () => resolve());
+ view.fit(extent, { callback: () => map.render() });
+ });
+}
+
+async function waitForRenderComplete(map) {
+ return new Promise((resolve) => {
+ map.once('rendercomplete', () => resolve());
+ map.render();
+ });
+}
+
+// Classnames to ignore for rendering in snapshot
+const classesToIgnore = [
+ 'wv-map-scale-imperial',
+ 'wv-map-scale-metric',
+];
+
+// Helper function for which elements to ignore for snapshot rendering
+function ignoreElementsFunc(element) {
+ return classesToIgnore.some((className) => element.classList.contains(className));
+}
+
+/**
+ * Create a snapshot of the map with the given options
+ * @param {Object} options - Snapshot configuration options
+ * @param {String} options.format - Output format (e.g., 'tif', 'png', 'kmz')
+ * @param {Number} options.metersPerPixel - Target spatial resolution in meters per pixel
+ * @param {Array} options.pixelBbox - Pixel bounding box [minX, minY, maxX, maxY]
+ * @param {Object} options.map - OpenLayers map instance
+ * @param {Boolean} options.worldfile - Whether to include a worldfile
+ * @param {Boolean} options.useHighResTileGrids - Whether to use high resolution tile grids
+ * @param {AbortSignal} options.abortSignal - Optional AbortController signal to cancel operation
+ * @returns {Promise<void>} - Promise that resolves when snapshot is complete
+ * @throws {DOMException} - Throws AbortError if the operation is cancelled
+ */
+export async function snapshot(options) {
+ const { height: maxHeight = 0, width: maxWidth = 0 } = await estimateMaxCanvasSize();
+
+ const {
+ format,
+ metersPerPixel,
+ pixelBbox,
+ map,
+ worldfile,
+ abortSignal,
+ filename = 'Worldview Snapshot',
+ projection,
+ onerror,
+ width,
+ height,
+ } = options;
+
+ // Check if operation was cancelled before starting
+ if (abortSignal?.aborted) {
+ throw new DOMException('Snapshot operation was cancelled before starting', 'AbortError');
+ }
+
+ // Save original viewport size
+ const [originalWidth, originalHeight] = map.getSize();
+ const extent = getExtentFromPixelBbox(pixelBbox, map);
+
+ const isGeoProjection = projection.id === 'geographic';
+
+ const config = isGeoProjection ? RESOLUTIONS_GEO : RESOLUTIONS_POLAR;
+ const tileMatrixID = config.values.find((res) => res.value === metersPerPixel)?.tileMatrixID;
+
+ // Create a restore function for the map state.
+ // This also manages the use of high-res tilegrids for the layers.
+ const restoreMap = createMapRestore(map, extent, abortSignal, tileMatrixID, onerror);
+ const view = map.getView();
+
+ // Add abort event listener to clean up if cancelled
+ const abortHandler = () => {
+ restoreMap();
+ };
+
+ if (abortSignal) {
+ abortSignal.addEventListener('abort', abortHandler);
+ }
+
+ await fitViewToExtent(map, extent);
+
+ const viewResolution = view.getResolution();
+
+ // Calculate scale factor based on target spatial resolution
+ const center = view.getCenter();
+ const scaleFactor = calculateScaleFactor(
+ metersPerPixel,
+ view.getProjection(),
+ viewResolution,
+ center,
+ );
+
+ // Scale the entire map up to the target resolution
+ const scaledMapWidth = evaluate(`${originalWidth} * ${scaleFactor}`);
+ const scaledMapHeight = evaluate(`${originalHeight} * ${scaleFactor}`);
+ const devicePixelRatio = window.devicePixelRatio || 1;
+ const scaledMapWidthWithDPR = evaluate(`${scaledMapWidth} * ${devicePixelRatio}`);
+ const scaledMapHeightWithDPR = evaluate(`${scaledMapHeight} * ${devicePixelRatio}`);
+
+ if (scaledMapWidthWithDPR > maxWidth || scaledMapHeightWithDPR > maxHeight) {
+ throw new Error(`Scaled area exceeds maximum allowed size: ${maxWidth}x${maxHeight}.
+ Current size: ${Math.floor(scaledMapWidthWithDPR)}x${Math.floor(scaledMapHeightWithDPR)}.`);
+ }
+
+ const scaledResolution = evaluate(`${viewResolution} / ${scaleFactor}`);
+ const mapElement = map.getTargetElement();
+
+ map.setSize([scaledMapWidth, scaledMapHeight]);
+ mapElement.style.width = `${scaledMapWidth}px`;
+ mapElement.style.height = `${scaledMapHeight}px`;
+ map.updateSize();
+ view.setResolution(scaledResolution);
+
+ await waitForRenderComplete(map);
+ // Allows time for tracks to re-adjust position/size
+ await new Promise((resolve) => {
+ setTimeout(resolve, 250);
+ });
+
+ const topLeft = olExtent.getTopLeft(extent);
+ const bottomLeft = olExtent.getBottomLeft(extent);
+ const topRight = olExtent.getTopRight(extent);
+
+ const aoiPixelTopLeft = map.getPixelFromCoordinate(topLeft);
+ const aoiPixelBottomLeft = map.getPixelFromCoordinate(bottomLeft);
+ const aoiPixelTopRight = map.getPixelFromCoordinate(topRight);
+
+ const aoiPixelXOffset = aoiPixelTopLeft[0];
+ const aoiPixelYOffset = aoiPixelTopLeft[1];
+ const aoiPixelWidth = Math.abs(evaluate(`${aoiPixelTopRight[0]} - ${aoiPixelTopLeft[0]}`));
+ const aoiPixelHeight = Math.abs(evaluate(`${aoiPixelBottomLeft[1]} - ${aoiPixelTopLeft[1]}`));
+
+ const [mapWidth, mapHeight] = map.getSize();
+
+ const dpr = window.devicePixelRatio || 1;
+
+ // Create our output canvas with exact dimensions we want
+ const outputWidth = evaluate(`${aoiPixelWidth} * ${dpr}`);
+ const outputHeight = evaluate(`${aoiPixelHeight} * ${dpr}`);
+ const outputCanvas = new OffscreenCanvas(outputWidth, outputHeight);
+
+ const ctx = outputCanvas.getContext('2d');
+ ctx.imageSmoothingEnabled = false; // Disable smoothing for pixel-perfect rendering
+
+ // Scale the context to ensure correct drawing operations
+ ctx.scale(dpr, dpr);
+
+ const capturedCanvas = new OffscreenCanvas(mapWidth * dpr, mapHeight * dpr);
+
+ // Capture the map at its new scaled size
+ await html2canvas(mapElement, {
+ canvas: capturedCanvas,
+ backgroundColor: null,
+ useCORS: true,
+ allowTaint: true,
+ scrollX: 0,
+ scrollY: 0,
+ scale: dpr,
+ logging: false,
+ imageTimeout: 0,
+ removeContainer: true,
+ ignoreElements: ignoreElementsFunc,
+ });
+
+ const sourceX = evaluate(`${aoiPixelXOffset} * ${dpr}`);
+ const sourceY = evaluate(`${aoiPixelYOffset} * ${dpr}`);
+ const sourceWidth = outputCanvas.width; // Use the actual width of the output canvas
+ const sourceHeight = outputCanvas.height; // Use the actual height of the output canvas
+
+ const capturedCtx = capturedCanvas.getContext('2d');
+ capturedCtx.imageSmoothingEnabled = false; // Disable smoothing for pixel-perfect rendering
+ const capturedImageData = capturedCtx.getImageData(
+ Math.round(sourceX), // source x
+ sourceY, // source y
+ sourceWidth, // source width
+ sourceHeight, // source height
+ { colorSpace: 'srgb' },
+ );
+
+ ctx.colorSpace = 'srgb';
+
+ ctx.putImageData(
+ capturedImageData,
+ 0, // dest x
+ 0, // dest y
+ 0, // source x
+ 0, // source y
+ sourceWidth, // dest width
+ sourceHeight, // dest height
+ );
+
+ // Reset map to original size
+ restoreMap();
+
+ const pngBlob = await outputCanvas.convertToBlob({
+ type: 'image/png',
+ quality: 1, // Maximum quality
+ });
+
+ const crs = map.getView()
+ .getProjection()
+ .getCode();
+
+ const georeferencedOutput = await georeference(pngBlob, {
+ extent,
+ crs,
+ metersPerPixel,
+ captureWidth: width,
+ captureHeight: height,
+ inputFormat: 'png',
+ outputFormat: format === 'kmz' ? 'kml' : format,
+ worldfile,
+ name: 'Worldview Snapshot',
+ description: 'Snapshot created with NASA Worldview',
+ });
+
+ if (georeferencedOutput.length > 1 || format === 'kmz') {
+ const zip = new JSZip();
+ georeferencedOutput.forEach(({ name, blob }) => zip.file(name, blob));
+ const zipBlob = await zip.generateAsync({
+ type: 'blob',
+ compression: 'DEFLATE',
+ compressionOptions: { level: 9 },
+ mimeType: format !== 'kmz' ? 'application/zip' : 'application/vnd.google-earth.kmz',
+ });
+
+ return initiateDownload(
+ zipBlob,
+ `${filename}.${format !== 'kmz' ? 'zip' : 'kmz'}`,
+ abortSignal,
+ );
+ }
+
+ const { blob } = georeferencedOutput[0];
+ return initiateDownload(blob, `${filename}.${format}`, abortSignal);
+}
+
export function imageUtilGetConversionFactor(proj) {
if (proj === 'geographic') return POLAR_ESTIMATION_CONSTANT;
return GEO_ESTIMATION_CONSTANT;
@@ -408,28 +1082,52 @@ export function imageUtilGetPixelValuesFromCoords(bottomLeft, topRight, map) {
};
}
-export function imageSizeValid(imgHeight, imgWidth, maxSize) {
- if (imgHeight === 0 && imgWidth === 0) {
- return false;
- }
- if (imgHeight > maxSize || imgWidth > maxSize) {
- return false;
- }
+export function imageSizeValid(options) {
+ const {
+ maxHeight,
+ maxWidth,
+ map,
+ resolution,
+ pixelBbox,
+ } = options;
+
+ const imgWidth = Math.abs(pixelBbox[1][0] - pixelBbox[0][0]);
+ const imgHeight = Math.abs(pixelBbox[1][1] - pixelBbox[0][1]);
+ const view = map.getView();
+ const projection = view.getProjection();
+ const center = view.getCenter();
+ const extent = getExtentFromPixelBbox(pixelBbox, map);
+ const viewResolution = view.getResolutionForExtent(extent);
+
+ const scaleFactor = calculateScaleFactor(
+ resolution,
+ projection,
+ viewResolution,
+ center,
+ );
+
+ const mapSize = map.getSize();
+ const [scaledWidth, scaledHeight] = mapSize.map((size) => size * scaleFactor);
+
+ const isZero = imgHeight === 0 && imgWidth === 0;
+ const isTooBig = scaledWidth > maxHeight || scaledHeight > maxWidth;
+
+ if (isZero || isTooBig) return false;
+
return true;
}
-export function getDimensions(projection, bounds, resolution) {
- const conversionFactor = imageUtilGetConversionFactor(projection);
- const imgWidth = Math.round(
- Math.abs(bounds[1][0] - bounds[0][0]) /
- conversionFactor /
- Number(resolution),
- );
- const imgHeight = Math.round(
- Math.abs(bounds[1][1] - bounds[0][1]) /
- conversionFactor /
- Number(resolution),
- );
+export function getDimensions(map, bounds, resolution) {
+ const projection = map.getView().getProjection();
+ const center = map.getView().getCenter();
+ const metersPerUnit = getMetersPerUnit(projection, center);
+
+ const mapWidth = Math.abs(bounds[1][0] - bounds[0][0]) * metersPerUnit;
+ const mapHeight = Math.abs(bounds[1][1] - bounds[0][1]) * metersPerUnit;
+
+ const imgWidth = Math.round(mapWidth / resolution);
+ const imgHeight = Math.round(mapHeight / resolution);
+
return { width: imgWidth, height: imgHeight };
}
export function getPercentageFromPixel(maxDimension, dimension) {
@@ -442,11 +1140,16 @@ export function getPixelFromPercentage(maxDimension, percent) {
/**
* Find if there are layers that cannot be downloaded
* @param {Array} visibleLayers
+ * @param {boolean} isFromSnapshot
*
* @return {Bool}
*/
-export function hasNonDownloadableVisibleLayer(visibleLayers) {
- return visibleLayers.some(({ disableSnapshot = false }) => disableSnapshot);
+export function hasNonDownloadableVisibleLayer(visibleLayers, isFromSnapshot = false) {
+ // Only needed during transition period where image snapshot is frontend and
+ // gif creation is backend. Should be removed when both are frontend,
+ // and the actual layer objects updated to remove disableSnapshot as needed
+ if (isFromSnapshot) return visibleLayers.some(({ disableSnapshot = false }) => disableSnapshot);
+ return visibleLayers.some(({ disableGIF = false }) => disableGIF);
}
/**
* Get string of layers to be removed if alert is accepted
@@ -467,25 +1170,33 @@ export function getNamesOfNondownloadableLayers(nonDownloadableLayers) {
/**
* Get warning that shows layers that will be removed if notification is accepted
* @param {Array} nonDownloadableLayers
+ * @param {boolean} isFromSnapshot
*
* @return {String}
*/
-export function getNonDownloadableLayerWarning(nonDownloadableLayer) {
+export function getNonDownloadableLayerWarning(nonDownloadableLayer, isFromSnapshot = false) {
const layerStr = getNamesOfNondownloadableLayers(nonDownloadableLayer);
if (!layerStr) return '';
const multiLayers = layerStr.indexOf(',') > -1;
const layerPluralStr = multiLayers ? 'layers' : 'layer';
const thisTheseStr = multiLayers ? 'these' : 'this';
- return `The ${layerStr} ${layerPluralStr} cannot be included in a snapshot. Would you like to temporarily hide ${thisTheseStr} layer?`;
+ const typeName = isFromSnapshot ? 'snapshot' : 'GIF';
+ return `The ${layerStr} ${layerPluralStr} cannot be included in a ${typeName}.
+ Would you like to temporarily hide ${thisTheseStr} layer?`;
}
/**
* Get array of layers that will be removed if notification is accepted
* @param {Array} visibleLayers
+ * @param {boolean} isFromSnapshot
*
* @return {Array}
*/
-export function getNonDownloadableLayers(visibleLayers) {
- return visibleLayers.filter(({ disableSnapshot = false }) => disableSnapshot);
+export function getNonDownloadableLayers(visibleLayers, isFromSnapshot = false) {
+ // Only needed during transition period where image snapshot is frontend and
+ // gif creation is backend. Should be removed when both are frontend,
+ // and the actual layer objects updated to remove disableSnapshot as needed
+ if (isFromSnapshot) return visibleLayers.filter(({ disableSnapshot = false }) => disableSnapshot);
+ return visibleLayers.filter(({ disableGIF = false }) => disableGIF);
}
/**
* Get dateline message for selecting snapshot area
@@ -505,10 +1216,14 @@ export function getAlertMessageIfCrossesDateline(date, geolonlat1, geolonlat2, p
const zeroedDate = util.clearTimeUTC(date);
const nextDay = formatDisplayDate(util.dateAdd(zeroedDate, 'day', 1));
const prevDay = formatDisplayDate(util.dateAdd(zeroedDate, 'day', -1));
- const buildString = (lineStr, dateStr) => `The selected snapshot area crosses ${lineStr} and uses imagery from the ${dateStr}.`;
+ const buildString = (lineStr, dateStr) =>
+ `The selected snapshot area crosses ${lineStr} and uses imagery from the ${dateStr}.`;
if (crossesNextDay && crossesPrevDay) {
// snapshot extends over both map wings
- alertMessage = buildString('both datelines', `previous day ${prevDay} and next day ${nextDay}`);
+ alertMessage = buildString(
+ 'both datelines',
+ `previous day ${prevDay} and next day ${nextDay}`,
+ );
} else if (crossesNextDay) {
// min longitude less than maxExtent min longitude (-180 geographic)
alertMessage = buildString('the dateline', `next day ${nextDay}`);
diff --git a/web/js/modules/image-download/util.test.js b/web/js/modules/image-download/util.test.js
index 630774e5d..2b2c66ae8 100644
--- a/web/js/modules/image-download/util.test.js
+++ b/web/js/modules/image-download/util.test.js
@@ -21,8 +21,24 @@ import {
imageUtilGetCoordsFromPixelValues,
imageUtilGetPixelValuesFromCoords,
GRANULE_LIMIT,
+ convertPngToKml,
+ georeference,
+ snapshot,
+ estimateMaxCanvasSize,
+ estimateMaxImageSize,
} from './util';
+jest.mock('ol/proj', () => ({
+ ...jest.requireActual('ol/proj'),
+ get: jest.fn((projString) => {
+ if (projString === 'EPSG:4326') {
+ return { getUnits: () => 'degrees', getMetersPerUnit: () => 111319.49079327358 };
+ } else {
+ return { getUnits: () => 'm', getMetersPerUnit: () => 1 };
+ }
+ }),
+}));
+
const geoResolutions = [
0.5625,
0.28125,
@@ -203,47 +219,69 @@ test('bboxWMS13 [imagedownload-bbox]', () => {
test('Default km resolution Calculation [imagedownload-default-resolution]', () => {
const zoom = 5;
- const isGeo = true;
- expect(imageUtilCalculateResolution(zoom, isGeo, geoResolutions)).toBe('4');
+ const proj = {
+ id: 'geographic',
+ selected: {
+ crs: 'EPSG:4326',
+ resolutions: geoResolutions,
+ },
+ };
+ const center = [0, 0];
+ expect(imageUtilCalculateResolution(zoom, proj, center)).toBe(1000);
});
test('Resolution calculation with negative zoom clamps to 0 [imagedownload-resolution-negative-zoom]', () => {
- expect(imageUtilCalculateResolution(-1, true, geoResolutions)).toBe('40');
+ const proj = { selected: { id: 'geographic', crs: 'EPSG:4326', resolutions: geoResolutions } };
+ const center = [0, 0];
+ expect(imageUtilCalculateResolution(-1, proj, center)).toBe(10000);
});
test('Resolution calculation with zoom beyond max clamps to last resolution [imagedownload-resolution-zoom-overflow]', () => {
- expect(imageUtilCalculateResolution(999, true, geoResolutions)).toBe('0.125');
+ const proj = { selected: { id: 'geographic', crs: 'EPSG:4326', resolutions: geoResolutions } };
+ const center = [0, 0];
+ expect(imageUtilCalculateResolution(999, proj, center)).toBe(250);
});
test('Resolution calculation for polar projection [imagedownload-resolution-polar]', () => {
- const polarResolutions = [500, 250, 125, 62.5, 31.25];
- expect(imageUtilCalculateResolution(1, false, polarResolutions)).toBe('1');
+ const proj = { selected: { id: 'arctic', crs: 'EPSG:3413', resolutions: [500, 250, 125, 62.5, 31.25] } };
+ const center = [0, 0];
+ expect(imageUtilCalculateResolution(1, proj, center)).toBe(250);
});
test('Resolution calculation bumps up at geo zoom 3 [imagedownload-resolution-zoom3]', () => {
- expect(imageUtilCalculateResolution(3, true, geoResolutions)).toBe('20');
+ const proj = { selected: { id: 'geographic', crs: 'EPSG:4326', resolutions: geoResolutions } };
+ const center = [0, 0];
+ expect(imageUtilCalculateResolution(3, proj, center)).toBe(10000);
});
test('Resolution calculation bumps up at geo zoom 4 [imagedownload-resolution-zoom4]', () => {
- expect(imageUtilCalculateResolution(4, true, geoResolutions)).toBe('4');
+ const proj = { selected: { id: 'geographic', crs: 'EPSG:4326', resolutions: geoResolutions } };
+ const center = [0, 0];
+ expect(imageUtilCalculateResolution(4, proj, center)).toBe(1000);
});
test('Resolution calculation bumps up at geo zoom 6 [imagedownload-resolution-zoom6]', () => {
- expect(imageUtilCalculateResolution(6, true, geoResolutions)).toBe('2');
+ const proj = { selected: { id: 'geographic', crs: 'EPSG:4326', resolutions: geoResolutions } };
+ const center = [0, 0];
+ expect(imageUtilCalculateResolution(6, proj, center)).toBe(1000);
});
test('Resolution calculation bumps up at geo zoom 7 [imagedownload-resolution-zoom7]', () => {
- expect(imageUtilCalculateResolution(7, true, geoResolutions)).toBe('1');
+ const proj = { selected: { id: 'geographic', crs: 'EPSG:4326', resolutions: geoResolutions } };
+ const center = [0, 0];
+ expect(imageUtilCalculateResolution(7, proj, center)).toBe(500);
});
-test('Resolution calculation bumps up at polar zoom 1 [imagedownload-resolution-polar-zoom1]', () => {
- const polarResolutions = [500, 250, 125, 62.5, 31.25];
- expect(imageUtilCalculateResolution(1, false, polarResolutions)).toBe('1');
+test('Resolution calculation bumps up at polar zoom 0 [imagedownload-resolution-polar-zoom0]', () => {
+ const proj = { selected: { id: 'arctic', crs: 'EPSG:3413', resolutions: [500, 250, 125, 62.5, 31.25] } };
+ const center = [0, 0];
+ expect(imageUtilCalculateResolution(0, proj, center)).toBe(500);
});
test('Resolution calculation bumps up at polar zoom 2 [imagedownload-resolution-polar-zoom2]', () => {
- const polarResolutions = [500, 250, 125, 62.5, 31.25];
- expect(imageUtilCalculateResolution(2, false, polarResolutions)).toBe('1');
+ const proj = { selected: { id: 'arctic', crs: 'EPSG:3413', resolutions: [500, 250, 125, 62.5, 31.25] } };
+ const center = [0, 0];
+ expect(imageUtilCalculateResolution(2, proj, center)).toBe(250);
});
// ------- imageUtilEstimateResolution -------
@@ -399,9 +437,20 @@ test('getTruncatedGranuleDates truncates when over GRANULE_LIMIT [imagedownload-
// ------- getDimensions -------
+const mockMap = {
+ getView: () => ({
+ getProjection: () => ({
+ getUnits: () => 'degrees',
+ getMetersPerUnit: () => 111000,
+ }),
+ getCenter: () => [0, 0],
+ }),
+};
+const resolution = 1000;
+
test('getDimensions returns correct width and height for geographic [imagedownload-dimensions-geo]', () => {
const bounds = [[0, 0], [1, 1]];
- const result = getDimensions('geographic', bounds, 1);
+ const result = getDimensions(mockMap, bounds, resolution);
expect(result).toHaveProperty('width');
expect(result).toHaveProperty('height');
expect(result.width).toBeGreaterThan(0);
@@ -410,7 +459,7 @@ test('getDimensions returns correct width and height for geographic [imagedownlo
test('getDimensions returns correct width and height for polar [imagedownload-dimensions-polar]', () => {
const bounds = [[0, 0], [1000000, 1000000]];
- const result = getDimensions('arctic', bounds, 1);
+ const result = getDimensions(mockMap, bounds, resolution);
expect(result.width).toBeGreaterThan(0);
expect(result.height).toBeGreaterThan(0);
});
@@ -428,18 +477,46 @@ test('getPixelFromPercentage calculates correct pixel [imagedownload-pixel-from-
});
// ------- imageSizeValid -------
-
-test('imageSizeValid returns false when both dimensions are 0 [imagedownload-size-valid-zero]', () => {
- expect(imageSizeValid(0, 0, 8200)).toBe(false);
-});
-
-test('imageSizeValid returns false when a dimension exceeds maxSize [imagedownload-size-valid-exceed]', () => {
- expect(imageSizeValid(9000, 100, 8200)).toBe(false);
- expect(imageSizeValid(100, 9000, 8200)).toBe(false);
-});
-
-test('imageSizeValid returns true for valid dimensions [imagedownload-size-valid-ok]', () => {
- expect(imageSizeValid(500, 500, 8200)).toBe(true);
+test('should return false for zero size', () => {
+ const mockMap = {
+ getView: () => ({
+ getProjection: () => ({ getUnits: () => 'degrees', getMetersPerUnit: () => 111000 }),
+ getCenter: () => [0, 0],
+ getResolutionForExtent: () => 1000,
+ }),
+ getSize: () => [1000, 1000],
+ getCoordinateFromPixel: jest.fn().mockReturnValue([0, 0]),
+ };
+ const options = {
+ maxHeight: 8192,
+ maxWidth: 8192,
+ map: mockMap,
+ resolution: 1000,
+ pixelBbox: [[0, 0], [0, 0]],
+ };
+ const result = imageSizeValid(options);
+ expect(result).toBe(false);
+});
+
+test('should return false for oversized image', () => {
+ const mockMapLarge = {
+ getView: () => ({
+ getProjection: () => ({ getUnits: () => 'degrees', getMetersPerUnit: () => 111000 }),
+ getCenter: () => [0, 0],
+ getResolutionForExtent: () => 1000,
+ }),
+ getSize: () => [10000, 10000],
+ getCoordinateFromPixel: jest.fn().mockReturnValue([0, 0]),
+ };
+ const options = {
+ maxHeight: 1000,
+ maxWidth: 1000,
+ map: mockMapLarge,
+ resolution: 1,
+ pixelBbox: [[0, 0], [100, 100]],
+ };
+ const result = imageSizeValid(options);
+ expect(result).toBe(false);
});
// ------- hasNonDownloadableVisibleLayer -------
@@ -447,7 +524,7 @@ test('imageSizeValid returns true for valid dimensions [imagedownload-size-valid
test('hasNonDownloadableVisibleLayer returns true when a layer has disableSnapshot [imagedownload-has-non-dl-true]', () => {
expect(hasNonDownloadableVisibleLayer([
{ disableSnapshot: true }, { disableSnapshot: false },
- ])).toBe(true);
+ ], true)).toBe(true);
});
test('hasNonDownloadableVisibleLayer returns false when no layers have disableSnapshot [imagedownload-has-non-dl-false]', () => {
@@ -458,7 +535,7 @@ test('hasNonDownloadableVisibleLayer returns false when no layers have disableSn
test('getNonDownloadableLayers filters to only disableSnapshot layers [imagedownload-get-non-dl-layers]', () => {
const layers = [{ id: 'A', disableSnapshot: true }, { id: 'B' }, { id: 'C', disableSnapshot: false }];
- expect(getNonDownloadableLayers(layers)).toEqual([{ id: 'A', disableSnapshot: true }]);
+ expect(getNonDownloadableLayers(layers, true)).toEqual([{ id: 'A', disableSnapshot: true }]);
});
test('getNonDownloadableLayers returns empty array when none disabled [imagedownload-get-non-dl-empty]', () => {
@@ -701,3 +778,117 @@ test('Download URL includes granule_dates when granuleDates present [imagedownlo
test('GRANULE_LIMIT is 30 [imagedownload-granule-limit]', () => {
expect(GRANULE_LIMIT).toBe(30);
});
+
+// Tests for coordinate conversion functions
+describe('coordinate conversion functions', () => {
+ beforeEach(() => {
+ jest.clearAllMocks();
+ });
+
+ test('getDimensions should calculate image dimensions', () => {
+ const mockMap = {
+ getView: () => ({
+ getProjection: () => ({
+ getUnits: () => 'degrees',
+ getMetersPerUnit: () => 111000,
+ }),
+ getCenter: () => [0, 0],
+ }),
+ };
+ const bounds = [[0, 0], [1, 1]];
+ const resolution = 1000;
+
+ const result = getDimensions(mockMap, bounds, resolution);
+ expect(result).toHaveProperty('width');
+ expect(result).toHaveProperty('height');
+ });
+});
+
+// Tests for canvas size estimation
+describe('canvas size functions', () => {
+ test('estimateMaxCanvasSize should return a function', () => {
+ const result = estimateMaxCanvasSize();
+ expect(typeof result).toBe('object');
+ });
+
+ test('estimateMaxImageSize should be an async function', async () => {
+ // Mock canvas-size to avoid environment issues
+ jest.doMock('canvas-size', () => ({
+ maxArea: () => Promise.resolve({ height: 8192, width: 8192 }),
+ }));
+
+ // This test would need proper mocking of canvas-size in a real test environment
+ expect(estimateMaxImageSize).toBeInstanceOf(Function);
+ });
+});
+
+// Tests for convertPngToKml
+describe('convertPngToKml', () => {
+ test('should reject non-Blob input', async () => {
+ await expect(convertPngToKml('not a blob', {})).rejects.toThrow('Input must be a Blob');
+ });
+
+ test('should reject non-WGS84 CRS', async () => {
+ const blob = new Blob(['fake png data'], { type: 'image/png' });
+ const options = { crs: 'EPSG:3857', extent: [0, 0, 1, 1] };
+ await expect(convertPngToKml(blob, options)).rejects.toThrow('KML requires WGS84 coordinates');
+ });
+
+ test('should create KML with valid inputs', async () => {
+ const blob = new Blob(['fake png data'], { type: 'image/png' });
+ const options = {
+ crs: 'EPSG:4326',
+ extent: [-180, -90, 180, 90],
+ name: 'Test Image',
+ };
+
+ const result = await convertPngToKml(blob, options);
+ expect(result).toBeInstanceOf(Blob);
+ expect(result.type).toBe('application/vnd.google-earth.kml+xml');
+ });
+});
+
+// Mock tests for async functions that require complex dependencies
+describe('complex async functions (mocked)', () => {
+ beforeEach(() => {
+ // Reset all mocks before each test
+ jest.clearAllMocks();
+ });
+
+ describe('georeference', () => {
+ test('should handle KML output format', async () => {
+ // Mock convertPngToKml to avoid complex dependencies
+ const mockKmlBlob = new Blob(['<kml></kml>'], { type: 'application/vnd.google-earth.kml+xml' });
+ jest.doMock('./util', () => ({
+ ...jest.requireActual('./util'),
+ convertPngToKml: jest.fn().mockResolvedValue(mockKmlBlob),
+ }));
+
+ // This would need proper mocking of GDAL in a real test environment
+ // For now, we're just testing that the function exists and is async
+ expect(georeference).toBeInstanceOf(Function);
+ });
+ });
+
+ describe('snapshot', () => {
+ test('should throw AbortError when already aborted', async () => {
+ const abortController = new AbortController();
+ abortController.abort();
+
+ const options = {
+ format: 'png',
+ metersPerPixel: 1000,
+ pixelBbox: [0, 0, 100, 100],
+ map: { getSize: () => [1000, 1000] },
+ abortSignal: abortController.signal,
+ };
+
+ await expect(snapshot(options)).rejects.toThrow(DOMException);
+ });
+
+ test('should be an async function', () => {
+ expect(snapshot).toBeInstanceOf(Function);
+ expect(snapshot.constructor.name).toBe('AsyncFunction');
+ });
+ });
+});
diff --git a/web/scss/components/image.scss b/web/scss/components/image.scss
index 008ce2cf6..862f74227 100644
--- a/web/scss/components/image.scss
+++ b/web/scss/components/image.scss
@@ -79,7 +79,7 @@
.wv-image-coords {
position: absolute;
- z-index: 4;
+ z-index: 1;
white-space: pre;
color: #fff;
text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
@@ -145,3 +145,30 @@
right: 20px;
width: 5px;
}
+
+.modal-dialog.snapshot-error {
+ position: absolute;
+ width: 25%;
+ left: 37.5%;
+ top: 160px;
+}
+
+.wv-snapshot-warning {
+ margin: 4px;
+ margin-bottom: 8px;
+ line-height: 19px !important;
+}
+
+.wv-snapshot-warning-icon {
+ font-size: 1.2em;
+ margin-right: 8px;
+}
+
+.snapshot-feedback {
+ color: #7bf !important;
+ cursor: pointer;
+}
+
+.snapshot-feedback:hover {
+ text-decoration: underline !important;
+}
diff --git a/web/scss/features/events.scss b/web/scss/features/events.scss
index 5c3bb6051..da78943c3 100644
--- a/web/scss/features/events.scss
+++ b/web/scss/features/events.scss
@@ -193,7 +193,6 @@
display: block;
height: 26px;
width: 26px;
- background: url("../images/natural-events/dot.svg");
}
.marker.selected {
@@ -204,7 +203,6 @@
transform-origin: center bottom;
position: relative;
height: 31px;
- background: url("../images/natural-events/pin.svg");
}
}
@@ -389,52 +387,18 @@
display: block;
height: 30px;
width: 30px;
- background: url("../images/natural-events/icon-critical.svg");
+}
+
+.event-icon-pin {
+ transform: scale(1.175);
+ transform-origin: center top;
+ position: absolute;
}
.wv-map .event-icon {
height: 26px;
width: 26px;
-}
-
-.event-icon-dustHaze {
- background: url("../images/natural-events/icon-dust-and-haze.svg");
-}
-
-.event-icon-icebergs {
- background: url("../images/natural-events/icon-icebergs.svg");
-}
-
-.event-icon-floods {
- background: url("../images/natural-events/icon-floods.svg");
-}
-
-.event-icon-manmade {
- background: url("../images/natural-events/icon-manmade.svg");
-}
-
-.event-icon-seaLakeIce {
- background: url("../images/natural-events/icon-icebergs.svg");
-}
-
-.event-icon-severeStorms {
- background: url("../images/natural-events/icon-severe-storms.svg");
-}
-
-.event-icon-snow {
- background: url("../images/natural-events/icon-snow.svg");
-}
-
-.event-icon-volcanoes {
- background: url("../images/natural-events/icon-volcanoes.svg");
-}
-
-.event-icon-waterColor {
- background: url("../images/natural-events/icon-water-color.svg");
-}
-
-.event-icon-wildfires {
- background: url("../images/natural-events/icon-wildfires.svg");
+ position: absolute;
}
.events-loading-text {
diff --git a/webpack.config.js b/webpack.config.js
index b1be38aa4..734ee603a 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -7,6 +7,7 @@ const CssMinimizerPlugin = require('css-minimizer-webpack-plugin')
const MomentLocalesPlugin = require('moment-locales-webpack-plugin')
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin')
const CssUrlRelativePlugin = require('css-url-relative-plugin')
+const CopyWebpackPlugin = require('copy-webpack-plugin')
const devMode = process.env.NODE_ENV !== 'production'
@@ -42,6 +43,16 @@ if (process.env.DEBUG !== undefined) {
)
}
+pluginSystem.push(
+ new CopyWebpackPlugin({
+ patterns: [
+ { from: './node_modules/gdal3.js/dist/package/gdal3.js', to: 'gdal3js' },
+ { from: './node_modules/gdal3.js/dist/package/gdal3WebAssembly.wasm', to: 'gdal3js' },
+ { from: './node_modules/gdal3.js/dist/package/gdal3WebAssembly.data', to: 'gdal3js' }
+ ]
+ })
+)
+
const babelLoaderExcludes = [
/\.test\.js$/,
/fixtures\.js$/,