Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Eric Duminil
RegionChooser
Commits
1a238391
Commit
1a238391
authored
2 years ago
by
Eric Duminil
Browse files
Options
Download
Email Patches
Plain Diff
Could be cleaner. Some day.
parent
5a39d8db
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/resources/eu/simstadt/regionchooser/website/script/simstadt_openlayers.js
+23
-6
...stadt/regionchooser/website/script/simstadt_openlayers.js
with
23 additions
and
6 deletions
+23
-6
src/main/resources/eu/simstadt/regionchooser/website/script/simstadt_openlayers.js
+
23
-
6
View file @
1a238391
...
...
@@ -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
]
.
append
Child
(
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
);
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment