[TASK] Configurable alert marker

This commit is contained in:
Xaver Maierhofer 2017-02-02 00:47:54 +01:00 committed by Geno
parent 28f481185d
commit 489739c7d8
3 changed files with 8 additions and 2 deletions

View File

@ -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.

View File

@ -28,6 +28,7 @@
"reverseGeocodingApi": "https://nominatim.openstreetmap.org/reverse",
"siteName": "Freifunk Regensburg",
"maxAge": 14,
"maxAgeAlert": 3,
"nodeZoom": 18,
"nodeInfobox": {
"contact": false,

View File

@ -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;