"...git@transfer.hft-stuttgart.de:m4lab_tv1/user-account.git" did not exist on "3a50b277132cb2148ec66b14f969e3ef796ae53d"
Commit 1a238391 authored by Eric Duminil's avatar Eric Duminil
Browse files

Could be cleaner. Some day.

parent 5a39d8db
No related merge requests found
Showing with 23 additions and 6 deletions
+23 -6
...@@ -153,7 +153,26 @@ const regionChooser = (function(){ ...@@ -153,7 +153,26 @@ const regionChooser = (function(){
var sketch_percentage = Math.round(intersectionArea / polygonArea * 100); var sketch_percentage = Math.round(intersectionArea / polygonArea * 100);
var id = feature.getId(); var id = feature.getId();
intersections.addFeature(intersection); 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();">' link += '<input type="checkbox" id="citygml_' + feature.getId() + '" class="select_citygml" onclick="regionChooser.isDownloadPossible();">'
+ '<label for="citygml_' + feature.getId() + '">' + feature['name'] + '</label>'; + '<label for="citygml_' + feature.getId() + '">' + feature['name'] + '</label>';
...@@ -161,16 +180,14 @@ const regionChooser = (function(){ ...@@ -161,16 +180,14 @@ const regionChooser = (function(){
if (sketch_percentage == 100) { if (sketch_percentage == 100) {
link += ", all inside"; link += ", all inside";
} }
dataPanel.append(link + ")\n"); */ dataPanel[0].appendChild(li);
} }
publicScope.highlightPolygon = function(i) { publicScope.highlightPolygon = function(feature) {
var feature = kml_source.getFeatureById(i);
feature.setStyle(styles.highlighted); feature.setStyle(styles.highlighted);
} }
publicScope.resetHighlight = function(i) { publicScope.resetHighlight = function(feature) {
var feature = kml_source.getFeatureById(i);
refreshStyle(feature); refreshStyle(feature);
} }
......
Supports Markdown
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