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

Broken.

parent 1a238391
...@@ -166,6 +166,7 @@ const regionChooser = (function(){ ...@@ -166,6 +166,7 @@ const regionChooser = (function(){
*/ let checkbox = li.appendChild(document.createElement('input')); */ let checkbox = li.appendChild(document.createElement('input'));
checkbox.type = 'checkbox' checkbox.type = 'checkbox'
checkbox.id = "citygml_" + feature.getId(); checkbox.id = "citygml_" + feature.getId();
checkbox.className = "select_citygml";
let label = li.appendChild(document.createElement('label')); let label = li.appendChild(document.createElement('label'));
label.setAttribute('for', "citygml_" + feature.getId()); label.setAttribute('for', "citygml_" + feature.getId());
label.textContent = feature.name; label.textContent = feature.name;
...@@ -202,12 +203,11 @@ const regionChooser = (function(){ ...@@ -202,12 +203,11 @@ const regionChooser = (function(){
kml_source.getFeatures().forEach(f => refreshStyle(f, "original")); kml_source.getFeatures().forEach(f => refreshStyle(f, "original"));
//TODO: Dry //TODO: Dry
var checkedBoxes = Array.from(document.querySelectorAll("input.select_citygml")).filter(c => c.checked); var selectedFeatures = Array.from(document.querySelectorAll("input.select_citygml")).filter(c => c.checked).map(c => c.feature);
var checkbox_ids = checkedBoxes.map(c => c.id); console.log(selectedFeatures);
var features = getCheckedPolygons(checkbox_ids); selectedFeatures.forEach(f => refreshStyle(f, "selected"));
features.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) { 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