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
e887cd80
Commit
e887cd80
authored
2 weeks ago
by
Tor-Einar Skog
Browse files
Options
Downloads
Patches
Plain Diff
Squares and triangles for large quantity registrations
parent
246a2527
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/fireblight/js/map.js
+49
-27
49 additions, 27 deletions
src/main/webapp/map_applications/fireblight/js/map.js
with
49 additions
and
27 deletions
src/main/webapp/map_applications/fireblight/js/map.js
+
49
−
27
View file @
e887cd80
...
...
@@ -42,58 +42,80 @@ async function initMap()
// Icon styling for the observations layer
var
iconRadius
=
10
;
var
styles
=
{
// Bulkemispel = rød
'
cotoneaster bullatus
'
:
[
new
ol
.
style
.
Style
({
image
:
new
ol
.
style
.
Circle
({
'
cotoneaster bullatus
'
:
{
fill
:
new
ol
.
style
.
Fill
({
color
:
[
255
,
0
,
0
,
1
]}),
stroke
:
new
ol
.
style
.
Stroke
({
width
:
1
,
color
:
[
0
,
0
,
0
,
1
]}),
radius
:
iconRadius
})
})],
},
// Sprikemispel = dyp oransje
'
cotoneaster divaricata
'
:
[
new
ol
.
style
.
Style
({
image
:
new
ol
.
style
.
Circle
({
'
cotoneaster divaricata
'
:{
fill
:
new
ol
.
style
.
Fill
({
color
:
[
239
,
133
,
19
,
1
]}),
stroke
:
new
ol
.
style
.
Stroke
({
width
:
1
,
color
:
[
0
,
0
,
0
,
1
]}),
radius
:
iconRadius
})
})],
},
// Pilemispel = gul
'
cotoneaster salicifolia
'
:
[
new
ol
.
style
.
Style
({
image
:
new
ol
.
style
.
Circle
({
'
cotoneaster salicifolia
'
:{
fill
:
new
ol
.
style
.
Fill
({
color
:
[
239
,
236
,
19
,
1
]}),
stroke
:
new
ol
.
style
.
Stroke
({
width
:
1
,
color
:
[
0
,
0
,
0
,
1
]}),
radius
:
iconRadius
})
})],
},
// Eple = grønn
'
malus domestica
'
:
[
new
ol
.
style
.
Style
({
image
:
new
ol
.
style
.
Circle
({
'
malus domestica
'
:
{
fill
:
new
ol
.
style
.
Fill
({
color
:
[
0
,
255
,
0
,
1
]}),
stroke
:
new
ol
.
style
.
Stroke
({
width
:
1
,
color
:
[
0
,
0
,
0
,
1
]}),
radius
:
iconRadius
})
})],
},
// Pære = grågrønn
'
pyrus communis
'
:
[
new
ol
.
style
.
Style
({
image
:
new
ol
.
style
.
Circle
({
'
pyrus communis
'
:
{
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
({
'
plantae
'
:
{
fill
:
new
ol
.
style
.
Fill
({
color
:
[
0
,
0
,
255
,
1
]}),
stroke
:
new
ol
.
style
.
Stroke
({
width
:
1
,
color
:
[
0
,
0
,
0
,
1
]}),
radius
:
iconRadius
})
})
]
}
};
// Change icon shape based on the quantity of the observation
const
getShape
=
function
(
observationData
,
styleProps
){
if
(
observationData
[
"
forekomststorrelse
"
]
==
"
100 planter
"
){
return
new
ol
.
style
.
Style
({
image
:
new
ol
.
style
.
RegularShape
({
points
:
4
,
fill
:
styleProps
.
fill
,
stroke
:
styleProps
.
stroke
,
radius
:
styleProps
.
radius
})
});
}
if
(
observationData
[
"
forekomststorrelse
"
]
==
"
Mer enn 100 planter
"
){
return
new
ol
.
style
.
Style
({
image
:
new
ol
.
style
.
RegularShape
({
points
:
3
,
fill
:
styleProps
.
fill
,
stroke
:
styleProps
.
stroke
,
radius
:
styleProps
.
radius
})
});
}
return
new
ol
.
style
.
Style
({
image
:
new
ol
.
style
.
Circle
({
fill
:
styleProps
.
fill
,
stroke
:
styleProps
.
stroke
,
radius
:
styleProps
.
radius
})
});
}
// Initialize the layer for observations. Empty features array at first
featureOverlay
=
new
ol
.
layer
.
Vector
({
source
:
new
ol
.
source
.
Vector
({
...
...
@@ -125,10 +147,10 @@ async function initMap()
var
retVal
=
null
;
if
(
feature
.
get
(
"
cropOrganism
"
)
!=
null
&&
feature
.
get
(
"
cropOrganism
"
)[
"
latinName
"
]
!=
null
)
{
retVal
=
styles
[
feature
.
get
(
"
cropOrganism
"
)[
"
latinName
"
].
toLowerCase
()];
retVal
=
[
getShape
(
observationData
,
styles
[
feature
.
get
(
"
cropOrganism
"
)[
"
latinName
"
].
toLowerCase
()]
)]
;
}
else
{
retVal
=
styles
[
"
plantae
"
];
retVal
=
[
getShape
(
observationData
,
styles
[
"
plantae
"
]
)]
;
}
//console.info(retVal[0].getImage().getStroke().getWidth());
// If symptom has been registered, mark with inner black dot
...
...
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