Skip to content

Commit

Permalink
#115 disable non-numeric field
Browse files Browse the repository at this point in the history
  • Loading branch information
webgisdeveloper committed Nov 28, 2021
1 parent a6bebea commit 880cef1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion simccs_maptool/static/js/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,15 @@ function update_style(stylelayerid) {
});
//console.log(color_field_value.every(Number.isFinite));
if (! color_field_value.every(Number.isFinite)) {
alert(color_field + " has no valid numberic value, please choose another field for coloring.");
alert(color_field + " has no valid numeric value, please choose another field for coloring.");
// disable the field
Array.from(document.getElementById(stylelayerid + "_style_field").options).forEach(function(option_element) {
let option_value = option_element.value;
if (option_value == color_field) {
option_element.disabled = true;
}
});

return;
}
var newlimits = chroma.limits(color_field_value, color_method, color_step - 1);
Expand Down

0 comments on commit 880cef1

Please sign in to comment.