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
3ab3caa8
Commit
3ab3caa8
authored
Oct 14, 2022
by
Eric Duminil
Browse files
Possibly less broken
parent
1bf3ac9c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/resources/eu/simstadt/regionchooser/website/script/simstadt_openlayers.js
View file @
3ab3caa8
...
...
@@ -161,27 +161,25 @@ const regionChooser = (function(){
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
'
));
let
checkbox
=
li
.
appendChild
(
document
.
createElement
(
'
input
'
));
checkbox
.
type
=
'
checkbox
'
checkbox
.
id
=
"
citygml_
"
+
feature
.
getId
();
checkbox
.
className
=
"
select_citygml
"
;
checkbox
.
feature
=
feature
;
checkbox
.
setAttribute
(
'
onclick
'
,
"
regionChooser.isDownloadPossible()
"
);
let
label
=
li
.
appendChild
(
document
.
createElement
(
'
label
'
));
label
.
setAttribute
(
'
for
'
,
"
citygml_
"
+
feature
.
getId
());
label
.
textContent
=
feature
.
name
;
checkbox
.
setAttribute
(
'
onclick
'
,
"
regionChooser.isDownloadPossible()
"
);
var
text
=
feature
.
name
;
/* 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>';
link += " (" + citygml_percentage + "%";
text
+=
"
(
"
+
citygml_percentage
+
"
%
"
;
if
(
sketch_percentage
==
100
)
{
link
+= ", all inside";
text
+=
"
, all inside
"
;
}
*/
dataPanel
[
0
].
appendChild
(
li
);
label
.
textContent
=
text
+
"
)
\n
"
;
dataPanel
[
0
].
appendChild
(
li
);
}
publicScope
.
highlightPolygon
=
function
(
feature
)
{
...
...
@@ -204,7 +202,6 @@ const regionChooser = (function(){
//TODO: Dry
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
=
(
selectedFeatures
.
length
==
0
);
...
...
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