From f58bffa7f4bf26f6ecbd33bf6569d4a03a168a71 Mon Sep 17 00:00:00 2001 From: Lisa Stillwell Date: Fri, 17 May 2024 10:33:57 -0400 Subject: [PATCH] updates to add maxinundepth layer --- .../drawer/layer-details/tabs/edit-range.js | 21 ++++++++++++++++++- .../drawer/layers-list/layer-card.js | 3 ++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/lib/custom-ui/components/drawer/layer-details/tabs/edit-range.js b/lib/custom-ui/components/drawer/layer-details/tabs/edit-range.js index 2299736b9..ab26da8ea 100644 --- a/lib/custom-ui/components/drawer/layer-details/tabs/edit-range.js +++ b/lib/custom-ui/components/drawer/layer-details/tabs/edit-range.js @@ -19,6 +19,7 @@ const minDistance = 0.0; const MAXELE_RANGE_MAX = 10; const MAXWVEL_RANGE_MAX = 100; const SWAN_RANGE_MAX = 30; +const MAXINUNDEPTH_RANGE_MAX = 5; export default function EditRange() { const { @@ -31,7 +32,7 @@ export default function EditRange() { } = useLayers(); // The following ranges are tightly coupled to the respective styles // must be updated if the styles change on GeoServer - // style names are: maxele_env_style_v2, maxwvel_env_style & swan_env_style + // style names are: maxele_env_style_v3, maxwvel_env_style, maxinundepth_env_style & swan_env_style // (style: maxele_env_style) //const maxele_range = [ @@ -60,6 +61,11 @@ export default function EditRange() { 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0 ]; + const maxinundepth_range = [ + 0.0, 0.0625, 0.125, 0.1875, 0.25, 0.3125, 0.375, 0.4375, 0.5, 0.5625, 0.625, + 0.6875, 0.75, 0.8125, 0.875, 0.9375, 1.0 + ]; + // collect all relevent range info let range_list = []; let default_max = 0; @@ -93,6 +99,19 @@ export default function EditRange() { { value: default_max, label: label3 }, { value: max_range, label: label4 } ]; + } else if (layer_id.includes("inund")) { + range_list = maxinundepth_range; + max_range = MAXINUNDEPTH_RANGE_MAX; + default_max = maxinundepth_range.slice(-1)[0]; + range_step = maxinundepth_range[1] - maxinundepth_range[0]; + let label3 = default_max + " m"; + let label4 = max_range + " m"; + marks = [ + { value: 0, label: "0 m" }, + { value: 0, label: "0 m" }, + { value: default_max, label: label3 }, + { value: max_range, label: label4 } + ]; } else { range_list = maxele_range; max_range = MAXELE_RANGE_MAX; diff --git a/lib/custom-ui/components/drawer/layers-list/layer-card.js b/lib/custom-ui/components/drawer/layers-list/layer-card.js index 4848da9e8..64dacce61 100644 --- a/lib/custom-ui/components/drawer/layers-list/layer-card.js +++ b/lib/custom-ui/components/drawer/layers-list/layer-card.js @@ -54,7 +54,8 @@ export const LayerCard = ({ obs: "Observations", maxwvel63: "Maximum Wind Velocity", maxele63: "Maximum Water Level", - swan_HS_max63: "Maximum Wave Height", + swan_HS_max63: "Maximum Significant Wave Height", + maxinundepth63: "Maximum Inundation Depth", maxele_level_downscaled_epsg4326: "Hi-Res Maximum Water Level", hec_ras_water_surface: "HEC/RAS Water Surface", hurr_composite: "Hurricane Track"