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
1bf3ac9c
Commit
1bf3ac9c
authored
Oct 14, 2022
by
Eric Duminil
Browse files
Broken.
parent
1a238391
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/resources/eu/simstadt/regionchooser/website/script/simstadt_openlayers.js
View file @
1bf3ac9c
...
...
@@ -166,6 +166,7 @@ const regionChooser = (function(){
*/
let
checkbox
=
li
.
appendChild
(
document
.
createElement
(
'
input
'
));
checkbox
.
type
=
'
checkbox
'
checkbox
.
id
=
"
citygml_
"
+
feature
.
getId
();
checkbox
.
className
=
"
select_citygml
"
;
let
label
=
li
.
appendChild
(
document
.
createElement
(
'
label
'
));
label
.
setAttribute
(
'
for
'
,
"
citygml_
"
+
feature
.
getId
());
label
.
textContent
=
feature
.
name
;
...
...
@@ -202,12 +203,11 @@ const regionChooser = (function(){
kml_source
.
getFeatures
().
forEach
(
f
=>
refreshStyle
(
f
,
"
original
"
));
//TODO: Dry
var
checkedBoxes
=
Array
.
from
(
document
.
querySelectorAll
(
"
input.select_citygml
"
)).
filter
(
c
=>
c
.
checked
);
var
checkbox_ids
=
checkedBoxes
.
map
(
c
=>
c
.
id
);
var
features
=
getCheckedPolygons
(
checkbox_ids
);
features
.
forEach
(
f
=>
refreshStyle
(
f
,
"
selected
"
));
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
=
(
ch
ec
k
ed
Box
es
.
length
==
0
);
document
.
getElementById
(
"
download_region_button
"
).
disabled
=
(
sel
ec
t
ed
Featur
es
.
length
==
0
);
}
function
findIntersection
(
feature
,
polygon
)
{
...
...
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