Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
VIPSLogic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VIPS
VIPSLogic
Commits
dbb0599f
Commit
dbb0599f
authored
5 months ago
by
Tor-Einar Skog
Browse files
Options
Downloads
Patches
Plain Diff
Feat: New hosts. Simplification of icon styles code. [VIPSUTV-988]
parent
d328bf21
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/webapp/map_applications/phytophthora/js/map.js
+18
-48
18 additions, 48 deletions
src/main/webapp/map_applications/phytophthora/js/map.js
with
18 additions
and
48 deletions
src/main/webapp/map_applications/phytophthora/js/map.js
+
18
−
48
View file @
dbb0599f
...
@@ -43,66 +43,31 @@ async function initMap() {
...
@@ -43,66 +43,31 @@ async function initMap() {
var
iconRadius
=
16
;
var
iconRadius
=
16
;
const
colors
=
{
const
colors
=
{
'
rhododendron
'
:
[
153
,
0
,
153
,
1
],
// Lilla 1
'
vaccinium myrtillus
'
:
[
204
,
0
,
204
,
1
],
// Lilla 2
'
pieris
'
:
[
255
,
0
,
255
,
1
],
// Lilla 3
'
viburnum
'
:
[
255
,
51
,
255
,
1
],
// Lilla 4
'
ericaceae
'
:
[
255
,
102
,
255
,
1
],
// Lilla 5
'
fagus sylvatica
'
:
[
255
,
0
,
0
,
1
],
// Bøk = rød
'
fagus sylvatica
'
:
[
255
,
0
,
0
,
1
],
// Bøk = rød
'
alnus incana
'
:
[
239
,
133
,
19
,
1
],
// Gråor = dyp oransje
'
alnus incana
'
:
[
239
,
133
,
19
,
1
],
// Gråor = dyp oransje
'
quercus
'
:
[
239
,
236
,
19
,
1
],
// Eik = gul
'
quercus
'
:
[
239
,
236
,
19
,
1
],
// Eik = gul
'
acer
'
:
[
0
,
255
,
0
,
1
],
// Lønn = grønn
'
acer
'
:
[
0
,
255
,
0
,
1
],
// Lønn = grønn
'
alnus glutinosa
'
:
[
122
,
175
,
131
,
1
],
// Svartor = grågrønn
'
alnus glutinosa
'
:
[
122
,
175
,
131
,
1
],
// Svartor = grågrønn
'
plantae
'
:
[
0
,
0
,
255
,
1
]
'
plantae
'
:
[
0
,
0
,
255
,
1
]
};
};
var
styles
=
{
let
styles
=
{};
// Bøk = rød
Object
.
entries
(
colors
).
forEach
(([
hostName
,
color
])
=>
{
'
fagus sylvatica
'
:
[
new
ol
.
style
.
Style
({
styles
[
hostName
]
=
[
new
ol
.
style
.
Style
({
image
:
new
ol
.
style
.
Circle
({
fill
:
new
ol
.
style
.
Fill
({
color
:
[
255
,
0
,
0
,
1
]
}),
stroke
:
new
ol
.
style
.
Stroke
({
width
:
1
,
color
:
[
0
,
0
,
0
,
1
]
}),
radius
:
iconRadius
})
})],
// Gråor = dyp oransje
'
alnus incana
'
:
[
new
ol
.
style
.
Style
({
image
:
new
ol
.
style
.
Circle
({
fill
:
new
ol
.
style
.
Fill
({
color
:
[
239
,
133
,
19
,
1
]
}),
stroke
:
new
ol
.
style
.
Stroke
({
width
:
1
,
color
:
[
0
,
0
,
0
,
1
]
}),
radius
:
iconRadius
})
})],
// Eik = gul
'
quercus
'
:
[
new
ol
.
style
.
Style
({
image
:
new
ol
.
style
.
Circle
({
fill
:
new
ol
.
style
.
Fill
({
color
:
[
239
,
236
,
19
,
1
]
}),
stroke
:
new
ol
.
style
.
Stroke
({
width
:
1
,
color
:
[
0
,
0
,
0
,
1
]
}),
radius
:
iconRadius
})
})],
// Lønn = grønn
'
acer
'
:
[
new
ol
.
style
.
Style
({
image
:
new
ol
.
style
.
Circle
({
image
:
new
ol
.
style
.
Circle
({
fill
:
new
ol
.
style
.
Fill
({
color
:
[
0
,
255
,
0
,
1
]
}),
fill
:
new
ol
.
style
.
Fill
({
color
:
color
}),
stroke
:
new
ol
.
style
.
Stroke
({
width
:
1
,
color
:
[
0
,
0
,
0
,
1
]
}),
stroke
:
new
ol
.
style
.
Stroke
({
width
:
1
,
color
:
[
0
,
0
,
0
,
1
]
}),
radius
:
iconRadius
radius
:
iconRadius
})
})
})],
})]
// Svartor = grågrønn
});
'
alnus glutinosa
'
:
[
new
ol
.
style
.
Style
({
image
:
new
ol
.
style
.
Circle
({
fill
:
new
ol
.
style
.
Fill
({
color
:
[
122
,
175
,
131
,
1
]
}),
stroke
:
new
ol
.
style
.
Stroke
({
width
:
1
,
color
:
[
0
,
0
,
0
,
1
]
}),
radius
:
iconRadius
})
})],
// Planteriket = blå
'
plantae
'
:
[
new
ol
.
style
.
Style
({
image
:
new
ol
.
style
.
Circle
({
fill
:
new
ol
.
style
.
Fill
({
color
:
[
0
,
0
,
255
,
1
]
}),
stroke
:
new
ol
.
style
.
Stroke
({
width
:
1
,
color
:
[
0
,
0
,
0
,
1
]
}),
radius
:
iconRadius
})
})
]
};
// Initialize the layer for observations. Empty features array at first
// Initialize the layer for observations. Empty features array at first
featureOverlay
=
new
ol
.
layer
.
Vector
({
featureOverlay
=
new
ol
.
layer
.
Vector
({
...
@@ -429,6 +394,11 @@ var displayFeature = function (feature) {
...
@@ -429,6 +394,11 @@ var displayFeature = function (feature) {
}
}
var
forekomsttypeLatinskeNavn
=
[
var
forekomsttypeLatinskeNavn
=
[
"
Rhododendron
"
,
"
Vaccinium myrtillus
"
,
// Blåbær
"
Pieris
"
,
// Pyramidelyng
"
Viburnum
"
,
// Korsved
"
Ericaceae
"
,
// Lyngfamilien
"
Fagus sylvatica
"
,
//"Bøk",
"
Fagus sylvatica
"
,
//"Bøk",
"
Alnus incana
"
,
//"Gråor",
"
Alnus incana
"
,
//"Gråor",
"
Quercus
"
,
//"Eik",
"
Quercus
"
,
//"Eik",
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment