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
ec11b3d8
Commit
ec11b3d8
authored
Oct 14, 2022
by
Eric Duminil
Browse files
rename
parent
2f951dcb
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/resources/eu/simstadt/regionchooser/website/script/simstadt_openlayers.js
View file @
ec11b3d8
...
...
@@ -89,7 +89,7 @@ var regionChooser = (function(){
// but to a feature overlay which holds a collection of features.
// This collection is passed to the modify and also the draw
// interaction, so that both can add or modify features.
var
featureOverlay
=
new
ol
.
FeatureOverlay
({
var
drawnLayer
=
new
ol
.
FeatureOverlay
({
style
:
new
ol
.
style
.
Style
({
fill
:
new
ol
.
style
.
Fill
({
color
:
'
rgba(255, 155, 51, 0.5)
'
...
...
@@ -106,11 +106,9 @@ var regionChooser = (function(){
})
})
});
featureOverlay
.
setMap
(
map
);
drawnLayer
.
setMap
(
map
);
//TODO: Rename to Javascript naming convention (CamelCase).
var
selected_features
=
featureOverlay
.
getFeatures
();
selected_features
.
on
(
'
add
'
,
function
(
event
)
{
drawnLayer
.
getFeatures
().
on
(
'
add
'
,
function
(
event
)
{
var
feature
=
event
.
element
;
feature
.
on
(
"
change
"
,
function
()
{
displayInfo
();
...
...
@@ -118,7 +116,7 @@ var regionChooser = (function(){
});
var
modify
=
new
ol
.
interaction
.
Modify
({
features
:
featureOverlay
.
getFeatures
(),
features
:
drawnLayer
.
getFeatures
(),
// the SHIFT key must be pressed to delete vertices, so
// that new vertices can be drawn at the same position
// of existing vertices
...
...
@@ -129,7 +127,7 @@ var regionChooser = (function(){
map
.
addInteraction
(
modify
);
var
draw
=
new
ol
.
interaction
.
Draw
({
features
:
featureOverlay
.
getFeatures
(),
features
:
drawnLayer
.
getFeatures
(),
type
:
'
Polygon
'
});
map
.
addInteraction
(
draw
);
...
...
@@ -317,7 +315,7 @@ var regionChooser = (function(){
displayHelp
();
document
.
documentElement
.
className
=
''
;
// Stop waiting
draw
.
setActive
(
true
);
featureOverlay
.
getFeatures
().
clear
();
drawnLayer
.
getFeatures
().
clear
();
intersections
.
clear
();
focusOnMap
();
}
...
...
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