Skip to content

Commit

Permalink
updates to add maxinundepth layer
Browse files Browse the repository at this point in the history
  • Loading branch information
lstillwe committed May 17, 2024
1 parent 535be1b commit f58bffa
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
21 changes: 20 additions & 1 deletion lib/custom-ui/components/drawer/layer-details/tabs/edit-range.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 = [
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion lib/custom-ui/components/drawer/layers-list/layer-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit f58bffa

Please sign in to comment.