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
016b2406
Commit
016b2406
authored
8 months ago
by
Tor-Einar Skog
Browse files
Options
Downloads
Patches
Plain Diff
Temporary storage of file
parent
b6c7d478
Branches
Branches containing commit
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
+89
-3
89 additions, 3 deletions
src/main/webapp/map_applications/phytophthora/js/map.js
with
89 additions
and
3 deletions
src/main/webapp/map_applications/phytophthora/js/map.js
+
89
−
3
View file @
016b2406
...
@@ -40,7 +40,18 @@ async function initMap() {
...
@@ -40,7 +40,18 @@ async function initMap() {
var
features
=
new
ol
.
Collection
();
var
features
=
new
ol
.
Collection
();
// Icon styling for the observations layer
// Icon styling for the observations layer
var
iconRadius
=
10
;
var
iconRadius
=
16
;
const
colors
=
{
'
fagus sylvatica
'
:
[
255
,
0
,
0
,
1
],
// Bøk = rød
'
alnus incana
'
:
[
239
,
133
,
19
,
1
],
// Gråor = dyp oransje
'
quercus
'
:
[
239
,
236
,
19
,
1
],
// Eik = gul
'
acer
'
:
[
0
,
255
,
0
,
1
],
// Lønn = grønn
'
alnus glutinosa
'
:
[
122
,
175
,
131
,
1
],
// Svartor = grågrønn
'
plantae
'
:
[
0
,
0
,
255
,
1
]
};
var
styles
=
{
var
styles
=
{
// Bøk = rød
// Bøk = rød
'
fagus sylvatica
'
:
[
new
ol
.
style
.
Style
({
'
fagus sylvatica
'
:
[
new
ol
.
style
.
Style
({
...
@@ -103,24 +114,99 @@ async function initMap() {
...
@@ -103,24 +114,99 @@ async function initMap() {
var
observationData
=
JSON
.
parse
(
feature
.
get
(
"
observationData
"
));
var
observationData
=
JSON
.
parse
(
feature
.
get
(
"
observationData
"
));
var
retVal
=
null
;
var
retVal
=
null
;
const
color
=
feature
.
get
(
"
cropOrganism
"
)
!=
null
&&
feature
.
get
(
"
cropOrganism
"
)[
"
latinName
"
]
!=
null
?
colors
[
feature
.
get
(
"
cropOrganism
"
)[
"
latinName
"
].
toLowerCase
()]
:
colors
[
"
plantae
"
];
/*
if (feature.get("cropOrganism") != null && feature.get("cropOrganism")["latinName"] != null) {
if (feature.get("cropOrganism") != null && feature.get("cropOrganism")["latinName"] != null) {
retVal = styles[feature.get("cropOrganism")["latinName"].toLowerCase()];
retVal = styles[feature.get("cropOrganism")["latinName"].toLowerCase()];
} else {
} else {
retVal = styles["plantae"];
retVal = styles["plantae"];
}
}
*/
//console.info(retVal[0].getImage().getStroke().getWidth());
//console.info(retVal[0].getImage().getStroke().getWidth());
// If symptom has been registered, mark with inner black dot
// If symptom has been registered, mark with inner black dot
if
(
observationData
[
"
symptom
"
]
!=
"
Ikke symptom
"
&&
observationData
[
"
symptom
"
]
!=
"
Irrelevant
"
)
{
retVal
=
[
new
ol
.
style
.
Style
({
image
:
new
ol
.
style
.
Circle
({
fill
:
new
ol
.
style
.
Fill
({
color
:
(
observationData
[
"
funn
"
]
==
"
[Ukjent]
"
?
color
:
[
0
,
0
,
0
,
1
])
}),
stroke
:
new
ol
.
style
.
Stroke
({
width
:
(
observationData
[
"
funn
"
]
==
"
[Ukjent]
"
?
0
:
4
),
color
:
(
observationData
[
"
funn
"
]
==
"
[Ukjent]
"
?
[
0
,
0
,
0
,
1
]
:
color
)
}),
radius
:
iconRadius
}),
text
:
new
ol
.
style
.
Text
({
text
:
observationData
[
"
provenummer
"
],
font
:
'
20px Arial
'
,
fill
:
new
ol
.
style
.
Fill
({
color
:
'
#000
'
}),
stroke
:
new
ol
.
style
.
Stroke
({
color
:
'
#fff
'
,
width
:
2
})
})
})
];
/*
if (observationData["funn"] == "[Ukjent]") {
retVal = [
new ol.style.Style({
image: new ol.style.Circle({
fill: new ol.style.Fill({ color: [0, 0, 0, 1] }),
stroke: new ol.style.Stroke({ width: 8, color: retVal[0].getImage().getFill().getColor() }),
radius: iconRadius
})
})
];
}
else {
retVal = [
retVal = [
new ol.style.Style({
new ol.style.Style({
image: new ol.style.Circle({
image: new ol.style.Circle({
fill: new ol.style.Fill({ color: [0, 0, 0, 1] }),
fill: new ol.style.Fill({ color: [0, 0, 0, 1] }),
stroke: new ol.style.Stroke({ width: 8, color: retVal[0].getImage().getFill().getColor() }),
stroke: new ol.style.Stroke({ width: 8, color: retVal[0].getImage().getFill().getColor() }),
radius: iconRadius
radius: iconRadius
}),
text: new ol.style.Text({
text: observationData["provenummer"],
fill: new ol.style.Fill({
color: '#000'
}),
stroke: new ol.style.Stroke({
color: '#fff',
width: 2
})
})
})
})
})
];
];
}
}
/*
,
text: new ol.style.Text({
text: "23",
fill: new ol.style.Fill({
color: '#000'
}),
stroke: new ol.style.Stroke({
color: '#fff',
width: 2
})
})*/
/*console.info(observationData["provenummer"])
if (observationData["provenummer"] != null && observationData["provenummer"].trim() != "") {
retVal.push(new ol.style.Style({
text: new ol.style.Text({
text: observationData["provenummer"],
fill: new ol.style.Fill({
color: '#000'
}),
stroke: new ol.style.Stroke({
color: '#fff',
width: 2
})
})
}))
}*/
//console.info(retVal);
return
retVal
;
return
retVal
;
}
}
...
...
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