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
dff7ef2a
Commit
dff7ef2a
authored
Oct 14, 2022
by
Eric Duminil
Browse files
Refactor.
parent
75ee91fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/resources/eu/simstadt/regionchooser/website/script/simstadt_openlayers.js
View file @
dff7ef2a
...
...
@@ -174,18 +174,21 @@ const regionChooser = (function(){
refreshStyle
(
feature
);
}
refreshStyle
=
function
(
feature
){
refreshStyle
=
function
(
feature
,
status
){
if
(
status
){
feature
.
status
=
status
;
}
feature
.
setStyle
(
styles
[
feature
.
status
]);
}
publicScope
.
isDownloadPossible
=
function
(){
kml_source
.
getFeatures
().
forEach
(
f
=>
{
f
.
status
=
"
original
"
;
refreshStyle
(
f
)}
);
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
=>
{
f
.
status
=
"
selected
"
;
refreshStyle
(
f
)}
);
features
.
forEach
(
f
=>
refreshStyle
(
f
,
"
selected
"
)
);
document
.
getElementById
(
"
download_region_button
"
).
disabled
=
(
checkedBoxes
.
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