Skip to content
Snippets Groups Projects
Commit 09026ab2 authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Make distinction between cleaned sites WITH and WITHOUT symptoms [PAER-20]

parent d0da481b
No related branches found
No related tags found
No related merge requests found
...@@ -71,20 +71,30 @@ var styles = { ...@@ -71,20 +71,30 @@ var styles = {
features: features features: features
}), }),
style: function(feature, resolution){ style: function(feature, resolution){
// Site that has been cleared is all black // Site that has been cleared is all black
var observationData = JSON.parse(feature.get("observationData")); var observationData = JSON.parse(feature.get("observationData"));
if(observationData["tiltak"] == "Ryddet") if(observationData["tiltak"] == "Ryddet" && observationData["symptom"] == "Ikke symptom")
{ {
return [new ol.style.Style({ return [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({ color: [0,0,0,1] }), stroke: new ol.style.Stroke({ color: [0,0,0,1] }),
radius: iconRadius radius: iconRadius
}) })
})]; })];
} }
else if(observationData["tiltak"] == "Ryddet" && observationData["symptom"] == "Symptom")
var retVal = null; {
return [new ol.style.Style({
image: new ol.style.Circle({
fill: new ol.style.Fill({ color: [255,255,255,1] }),
stroke: new ol.style.Stroke({ width: 8, color: [0,0,0,1] }),
radius: iconRadius
})
})];
}
var retVal = null;
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()];
...@@ -93,21 +103,21 @@ var styles = { ...@@ -93,21 +103,21 @@ var styles = {
{ {
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"] == "Symptom") if(observationData["symptom"] == "Symptom")
{ {
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
}) })
}) })
]; ];
} }
return retVal; return retVal;
} }
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment