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
c60aefd0
Commit
c60aefd0
authored
Oct 24, 2025
by
Eric Duminil
Browse files
Different color, hopefully suitable to multiple layers
parent
e99b059a
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/resources/eu/simstadt/regionchooser/website/script/simstadt_openlayers.js
View file @
c60aefd0
...
...
@@ -9,9 +9,9 @@ const regionChooser = (function () {
const
styles
=
{};
styles
.
original
=
utils
.
polygon_style
(
'
#447744
'
,
0.2
);
styles
.
highlighted
=
utils
.
polygon_style
(
"
#
ff44a2
"
,
0.
7
);
styles
.
selected
=
utils
.
polygon_style
(
"
#
ffff00
"
,
0.
8
);
styles
.
original
=
utils
.
polygon_style
(
"
#ee4266
"
,
0.2
);
styles
.
highlighted
=
utils
.
polygon_style
(
"
#
540d6e
"
,
0.
5
,
5
);
styles
.
selected
=
utils
.
polygon_style
(
"
#
540d6e
"
,
0.
7
,
5
);
publicScope
.
init
=
function
()
{
//NOTE: Only called from JavaFX. At startup, or when Repo has been changed.
...
...
@@ -41,7 +41,6 @@ const regionChooser = (function () {
});
var
arcgis_satellite
=
new
ol
.
layer
.
Tile
({
// TODO: Change polygon color when selected
source
:
new
ol
.
source
.
XYZ
({
attributions
:
""
,
url
:
'
https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}
'
,
...
...
src/main/resources/eu/simstadt/regionchooser/website/script/utils.js
View file @
c60aefd0
...
...
@@ -54,14 +54,14 @@ utils.is_polygon = function (geom) {
return
(
'
getType
'
in
geom
)
&&
(
geom
.
getType
()
===
'
Polygon
'
);
}
utils
.
polygon_style
=
function
(
color
,
alpha
)
{
utils
.
polygon_style
=
function
(
color
,
alpha
,
width
=
3
)
{
return
new
ol
.
style
.
Style
({
fill
:
new
ol
.
style
.
Fill
({
color
:
'
rgba(255, 255, 255,
'
+
alpha
+
'
)
'
}),
stroke
:
new
ol
.
style
.
Stroke
({
color
:
color
,
width
:
2
,
width
:
width
,
lineDash
:
[
5
,
10
]
}),
});
...
...
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