Commit 1bf3ac9c authored by Eric Duminil's avatar Eric Duminil
Browse files

Broken.

parent 1a238391
......@@ -166,6 +166,7 @@ const regionChooser = (function(){
*/ let checkbox = li.appendChild(document.createElement('input'));
checkbox.type = 'checkbox'
checkbox.id = "citygml_" + feature.getId();
checkbox.className = "select_citygml";
let label = li.appendChild(document.createElement('label'));
label.setAttribute('for', "citygml_" + feature.getId());
label.textContent = feature.name;
......@@ -202,12 +203,11 @@ const regionChooser = (function(){
kml_source.getFeatures().forEach(f => refreshStyle(f, "original"));
//TODO: Dry
var checkedBoxes = Array.from(document.querySelectorAll("input.select_citygml")).filter(c => c.checked);
var checkbox_ids = checkedBoxes.map(c => c.id);
var features = getCheckedPolygons(checkbox_ids);
features.forEach(f => refreshStyle(f, "selected"));
var selectedFeatures = Array.from(document.querySelectorAll("input.select_citygml")).filter(c => c.checked).map(c => c.feature);
console.log(selectedFeatures);
selectedFeatures.forEach(f => refreshStyle(f, "selected"));
document.getElementById("download_region_button").disabled = (checkedBoxes.length == 0);
document.getElementById("download_region_button").disabled = (selectedFeatures.length == 0);
}
function findIntersection(feature, polygon) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment