[TASK] Configurable alert marker
This commit is contained in:
parent
28f481185d
commit
489739c7d8
@ -96,6 +96,11 @@ Change this to match your communities' name. It will be used in various places.
|
||||
Nodes being online for less than maxAge days are considered "new". Likewise,
|
||||
nodes being offline for more than than maxAge days are considered "lost".
|
||||
|
||||
## maxAgeAlert (integer)
|
||||
|
||||
Nodes being offline for more than than maxAge days are considered "lost".
|
||||
Lost will be splitted in alert and lost.
|
||||
|
||||
## nodeZoom (integer)
|
||||
|
||||
Max level to be applied by clicking a node or open a node. With value `18` near by buildings and streets should be visible.
|
||||
|
@ -28,6 +28,7 @@
|
||||
"reverseGeocodingApi": "https://nominatim.openstreetmap.org/reverse",
|
||||
"siteName": "Freifunk Regensburg",
|
||||
"maxAge": 14,
|
||||
"maxAgeAlert": 3,
|
||||
"nodeZoom": 18,
|
||||
"nodeInfobox": {
|
||||
"contact": false,
|
||||
|
@ -473,11 +473,11 @@ define(['map/clientlayer', 'map/labelslayer',
|
||||
|
||||
var markersLost = data.nodes.lost.filter(helper.hasLocation)
|
||||
.map(mkMarker(nodeDict, function (d) {
|
||||
if (d.lastseen.isAfter(moment(data.now).subtract(3, 'days'))) {
|
||||
if (d.lastseen.isAfter(moment(data.now).subtract(config.maxAgeAlert, 'days'))) {
|
||||
return iconAlert;
|
||||
}
|
||||
|
||||
if (d.lastseen.isAfter(moment(data.now).subtract(14, 'days'))) {
|
||||
if (d.lastseen.isAfter(moment(data.now).subtract(config.maxAge, 'days'))) {
|
||||
return iconLost;
|
||||
}
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user