Clean-up severe thunderstorm and tornado alert presentation
This commit is contained in:
@ -34,13 +34,20 @@ let tornado = alerts.filter(function(alert) {
|
|||||||
|
|
||||||
// If there are any alerts, return them
|
// If there are any alerts, return them
|
||||||
|
|
||||||
msg.ts = ts
|
let tstormMsg = {
|
||||||
msg.ts_count = ts.length
|
"payload": {
|
||||||
|
"alerts": ts,
|
||||||
|
"count": ts.length,
|
||||||
|
"tornado_possible": tstp.length
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
msg.tstp = tstp
|
let tornadoWarnMsg = {
|
||||||
msg.tstp_count = tstp.length
|
"payload": {
|
||||||
|
"alerts": tornado,
|
||||||
|
"count": tornado.length
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
msg.tornado = tornado
|
node.send([tstormMsg,tornadoWarnMsg])
|
||||||
msg.tornado_count = tornado.length
|
node.status({fill:'green',shape:'dot',text:'Alerts Updated'})
|
||||||
|
|
||||||
return msg
|
|
@ -1,4 +1,5 @@
|
|||||||
let alerts = msg.payload.features
|
let alerts = msg.payload.features
|
||||||
|
let tornado_possible = false
|
||||||
|
|
||||||
// Filter for Severe Thunderstorm Warnings
|
// Filter for Severe Thunderstorm Warnings
|
||||||
|
|
||||||
@ -23,6 +24,10 @@ let tstp = alerts.filter(function(alert) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (tstp.length > 0) {
|
||||||
|
tornado_possible = true
|
||||||
|
}
|
||||||
|
|
||||||
// Filter for Tornado Warnings
|
// Filter for Tornado Warnings
|
||||||
|
|
||||||
let tornado = alerts.filter(function(alert) {
|
let tornado = alerts.filter(function(alert) {
|
||||||
@ -34,13 +39,20 @@ let tornado = alerts.filter(function(alert) {
|
|||||||
|
|
||||||
// If there are any alerts, return them
|
// If there are any alerts, return them
|
||||||
|
|
||||||
msg.ts = ts
|
let tstormMsg = {
|
||||||
msg.ts_count = ts.length
|
"payload": {
|
||||||
|
"alerts": ts,
|
||||||
|
"count": ts.length,
|
||||||
|
"tornado_possible": tornado_possible
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
msg.tstp = tstp
|
let tornadoWarnMsg = {
|
||||||
msg.tstp_count = tstp.length
|
"payload": {
|
||||||
|
"alerts": tornado,
|
||||||
|
"count": tornado.length
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
msg.tornado = tornado
|
node.send([tstormMsg,tornadoWarnMsg])
|
||||||
msg.tornado_count = tornado.length
|
node.status({fill:'green',shape:'dot',text:'Alerts Updated'})
|
||||||
|
|
||||||
return msg
|
|
Reference in New Issue
Block a user