Skip to content

Commit

Permalink
#115 update_style: get values
Browse files Browse the repository at this point in the history
  • Loading branch information
webgisdeveloper committed Nov 16, 2021
1 parent 5b2ddec commit 5c4540d
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion simccs_maptool/static/js/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,22 @@ function modifystyle(stylelayerid) {
selectstep.add(opt);
}
stylediv.appendChild(selectstep);

stylediv.innerHTML += "<br>"
stylediv.innerHTML += "<label >Colors: </label>"
var selectcolor = document.createElement("SELECT");
selectcolor.id = stylelayerid + "_style_color";
const colorthemelist = ["red,yellow,green","green,yellow,red","white,yellow,red","red,yellow,white","white,yellow,green","green,yellow,white"];
colorthemelist.forEach(function(item, index, array) {
var opt = document.createElement("option");
opt.text = item;
opt.value = item;
selectcolor.add(opt);
});
stylediv.appendChild(selectcolor);

stylediv.innerHTML +="<br>";
stylediv.innerHTML += '<button type="button" class="btn btn-primary btn-sm">Update Style</button>';
stylediv.innerHTML += '<button type="button" class="btn btn-primary btn-sm" onclick="update_style('+stylelayerid+')">Update Style</button>';
stylediv.innerHTML += '<button type="button" class="btn btn-primary btn-sm" onclick="cancel_style('+stylelayerid+')">Cancel</button>';
stylediv.innerHTML += "<br>";

Expand All @@ -200,6 +211,17 @@ function modifystyle(stylelayerid) {

}

// update style for a layer
function update_style(stylelayerid) {
// get options
var color_field = document.getElementById(stylelayerid + "_style_field").value;
var color_method = document.getElementById(stylelayerid + "_style_method").value;
var color_step = document.getElementById(stylelayerid + "_style_step").value;
var color_theme = document.getElementById(stylelayerid + "_style_color").value;
//console.log([color_field,color_method,color_step,color_theme]);
}

// cancel style
function cancel_style(stylelayerid){
var legenddiv = document.getElementById(stylelayerid + "_legend");
legenddiv.style.display = "block";
Expand Down

0 comments on commit 5c4540d

Please sign in to comment.