-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharcade-popup-tree-observations-arcade-block
21 lines (19 loc) · 1.37 KB
/
arcade-popup-tree-observations-arcade-block
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// define the variables
var treated = $feature.treatment_state
var risk = $feature.risk_for_hikers
var text = ''
// Define the text to be returned depending the risk for hikers and the treatmend state
if(treated == "No") {
when(risk == "low", text = "<p>The risk for hikers emerging from this <b>" + $feature.tree_type + "</b> with health issues of the type <b>" + $feature.tree_health_issue + "</b> is <b>low</b> and its treatment can be scheduled at a later stage.</p>",
risk == "moderate", text = "<p>The risk for hikers emerging from this <b>" + $feature.tree_type + "</b> with health issues of the type <b>" + $feature.tree_health_issue + "</b> is <b>moderate</b> and its treatment should soon be scheduled.</p>",
risk == "high", text = "<p>The risk for hikers emerging from this <b>" + $feature.tree_type + "</b> with health issues of the type <b>" + $feature.tree_health_issue + "</b> is <b>high</b> and its treatment should be scheduled for the next days.</p>",
text = "<p>The risk for hikers emerging from this <b>" + $feature.tree_type + "</b> with health issues of the type <b>" + $feature.tree_health_issue + "</b> is <b>very high</b> and should be treated immediatly.</p>"
)
} else {
text = "<p>This <b>" + $feature.tree_type + "</b> has been treated and is no longer a risk for the hikers in this area.</p>"
}
// return the defined text
return {
type: 'text',
text: text
}