[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 online for less than maxAge days are considered "new". Likewise,
|
||||||
nodes being offline for more than than maxAge days are considered "lost".
|
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)
|
## 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.
|
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",
|
"reverseGeocodingApi": "https://nominatim.openstreetmap.org/reverse",
|
||||||
"siteName": "Freifunk Regensburg",
|
"siteName": "Freifunk Regensburg",
|
||||||
"maxAge": 14,
|
"maxAge": 14,
|
||||||
|
"maxAgeAlert": 3,
|
||||||
"nodeZoom": 18,
|
"nodeZoom": 18,
|
||||||
"nodeInfobox": {
|
"nodeInfobox": {
|
||||||
"contact": false,
|
"contact": false,
|
||||||
|
@ -473,11 +473,11 @@ define(['map/clientlayer', 'map/labelslayer',
|
|||||||
|
|
||||||
var markersLost = data.nodes.lost.filter(helper.hasLocation)
|
var markersLost = data.nodes.lost.filter(helper.hasLocation)
|
||||||
.map(mkMarker(nodeDict, function (d) {
|
.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;
|
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 iconLost;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
Reference in New Issue
Block a user