Skip to content
GitLab
Explore
Projects
Groups
Snippets
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
2 years ago
by
Eric Duminil
Browse files
Options
Download
Email Patches
Plain Diff
Refactor.
parent
75ee91fc
master
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/resources/eu/simstadt/regionchooser/website/script/simstadt_openlayers.js
+6
-3
...stadt/regionchooser/website/script/simstadt_openlayers.js
with
6 additions
and
3 deletions
+6
-3
src/main/resources/eu/simstadt/regionchooser/website/script/simstadt_openlayers.js
+
6
-
3
View file @
dff7ef2a
...
@@ -174,18 +174,21 @@ const regionChooser = (function(){
...
@@ -174,18 +174,21 @@ const regionChooser = (function(){
refreshStyle
(
feature
);
refreshStyle
(
feature
);
}
}
refreshStyle
=
function
(
feature
){
refreshStyle
=
function
(
feature
,
status
){
if
(
status
){
feature
.
status
=
status
;
}
feature
.
setStyle
(
styles
[
feature
.
status
]);
feature
.
setStyle
(
styles
[
feature
.
status
]);
}
}
publicScope
.
isDownloadPossible
=
function
(){
publicScope
.
isDownloadPossible
=
function
(){
kml_source
.
getFeatures
().
forEach
(
f
=>
{
f
.
status
=
"
original
"
;
refreshStyle
(
f
)}
);
kml_source
.
getFeatures
().
forEach
(
f
=>
refreshStyle
(
f
,
"
original
"
)
);
//TODO: Dry
//TODO: Dry
var
checkedBoxes
=
Array
.
from
(
document
.
querySelectorAll
(
"
input.select_citygml
"
)).
filter
(
c
=>
c
.
checked
);
var
checkedBoxes
=
Array
.
from
(
document
.
querySelectorAll
(
"
input.select_citygml
"
)).
filter
(
c
=>
c
.
checked
);
var
checkbox_ids
=
checkedBoxes
.
map
(
c
=>
c
.
id
);
var
checkbox_ids
=
checkedBoxes
.
map
(
c
=>
c
.
id
);
var
features
=
getCheckedPolygons
(
checkbox_ids
);
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
);
document
.
getElementById
(
"
download_region_button
"
).
disabled
=
(
checkedBoxes
.
length
==
0
);
}
}
...
...
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
Menu
Explore
Projects
Groups
Snippets