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

Could be cleaner. Some day.

parent 5a39d8db
......@@ -153,7 +153,26 @@ const regionChooser = (function(){
var sketch_percentage = Math.round(intersectionArea / polygonArea * 100);
var id = feature.getId();
intersections.addFeature(intersection);
var link = '<li onmouseover="regionChooser.highlightPolygon(' + id + ')" onmouseout="regionChooser.resetHighlight(' + id +')">';
//TODO: Clean this mess. No jquery
li = document.createElement('li');
li.feature = feature;
li.onmouseover = function(){ regionChooser.highlightPolygon(this.feature) };
li.onmouseout = function(){ regionChooser.resetHighlight(this.feature) };
/* li.setAttribute('onmouseover', 'regionChooser.highlightPolygon(' + id + ')"');
li.setAttribute('onmouseout', 'regionChooser.resetHighlight(' + id + ')"');
*/ let checkbox = li.appendChild(document.createElement('input'));
checkbox.type = 'checkbox'
checkbox.id = "citygml_" + feature.getId();
let label = li.appendChild(document.createElement('label'));
label.setAttribute('for', "citygml_" + feature.getId());
label.textContent = feature.name;
checkbox.setAttribute('onclick', "regionChooser.isDownloadPossible()");
/* var link = '<li onmouseover="regionChooser.highlightPolygon(' + id + ')" onmouseout="regionChooser.resetHighlight(' + id +')">';
link += '<input type="checkbox" id="citygml_' + feature.getId() + '" class="select_citygml" onclick="regionChooser.isDownloadPossible();">'
+ '<label for="citygml_' + feature.getId() + '">' + feature['name'] + '</label>';
......@@ -161,16 +180,14 @@ const regionChooser = (function(){
if (sketch_percentage == 100) {
link += ", all inside";
}
dataPanel.append(link + ")\n");
*/ dataPanel[0].appendChild(li);
}
publicScope.highlightPolygon = function(i) {
var feature = kml_source.getFeatureById(i);
publicScope.highlightPolygon = function(feature) {
feature.setStyle(styles.highlighted);
}
publicScope.resetHighlight = function(i) {
var feature = kml_source.getFeatureById(i);
publicScope.resetHighlight = function(feature) {
refreshStyle(feature);
}
......
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