use circleMarkers again
This commit is contained in:
parent
0c74ddec8f
commit
090b6c1d79
35
history.html
35
history.html
@ -207,41 +207,6 @@
|
|||||||
right: 0.5em;
|
right: 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-marker-icon.node-online {
|
|
||||||
filter: hue-rotate(203deg) brightness(1.5);
|
|
||||||
-webkit-filter: hue-rotate(203deg) brightness(1.5);
|
|
||||||
opacity: 0.9;
|
|
||||||
}
|
|
||||||
|
|
||||||
.leaflet-marker-icon.node-new {
|
|
||||||
filter: hue-rotate(88deg) brightness(1.5);
|
|
||||||
-webkit-filter: hue-rotate(88deg) brightness(1.5);
|
|
||||||
}
|
|
||||||
|
|
||||||
.leaflet-marker-icon.node-offline {
|
|
||||||
filter: saturate(160%);
|
|
||||||
-webkit-filter: saturate(160%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.leaflet-marker-icon.node-alert {
|
|
||||||
-webkit-animation: blink 2s linear;
|
|
||||||
-webkit-animation-iteration-count: infinite;
|
|
||||||
animation: blink 2s linear;
|
|
||||||
animation-iteration-count: infinite;
|
|
||||||
}
|
|
||||||
|
|
||||||
@-webkit-keyframes blink {
|
|
||||||
0% { opacity: 1.0; }
|
|
||||||
80% { opacity: 1.0; }
|
|
||||||
90% { opacity: 0.0; }
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes blink {
|
|
||||||
0% { opacity: 1.0; }
|
|
||||||
80% { opacity: 1.0; }
|
|
||||||
90% { opacity: 0.0; }
|
|
||||||
}
|
|
||||||
|
|
||||||
@media screen and (max-width: 80em) {
|
@media screen and (max-width: 80em) {
|
||||||
.sidebar {
|
.sidebar {
|
||||||
font-size: 0.8em;
|
font-size: 0.8em;
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 618 B |
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB |
36
lib/map.js
36
lib/map.js
@ -4,11 +4,7 @@ define(function () {
|
|||||||
}
|
}
|
||||||
function mkMarker(dict, iconFunc, gotoAnything) {
|
function mkMarker(dict, iconFunc, gotoAnything) {
|
||||||
return function (d) {
|
return function (d) {
|
||||||
var opt = { icon: iconFunc(d),
|
var m = L.circleMarker([d.nodeinfo.location.latitude, d.nodeinfo.location.longitude], iconFunc(d))
|
||||||
title: d.nodeinfo.hostname
|
|
||||||
}
|
|
||||||
|
|
||||||
var m = L.marker([d.nodeinfo.location.latitude, d.nodeinfo.location.longitude], opt)
|
|
||||||
|
|
||||||
m.on('click', gotoAnything.node(d, false))
|
m.on('click', gotoAnything.node(d, false))
|
||||||
m.bindPopup(d.nodeinfo.hostname)
|
m.bindPopup(d.nodeinfo.hostname)
|
||||||
@ -42,28 +38,9 @@ define(function () {
|
|||||||
return lines
|
return lines
|
||||||
}
|
}
|
||||||
|
|
||||||
var iconBase = { iconUrl: 'img/circlemarker.png',
|
var iconOnline = { color: "#1566A9", radius: 6, fillOpacity: 0.5 }
|
||||||
iconRetinaUrl: 'img/circlemarker@2x.png',
|
var iconOffline = { color: "#D43E2A", radius: 6, fillOpacity: 0.5 }
|
||||||
iconSize: [17, 17],
|
var iconNew = { color: "#558020", radius: 6, fillOpacity: 0.5 }
|
||||||
iconAnchor: [8, 8],
|
|
||||||
popupAnchor: [0, -3]
|
|
||||||
}
|
|
||||||
|
|
||||||
var iconOnline = Object.assign({}, iconBase)
|
|
||||||
iconOnline.className = "node-online"
|
|
||||||
iconOnline = L.icon(iconOnline)
|
|
||||||
|
|
||||||
var iconOffline = Object.assign({}, iconBase)
|
|
||||||
iconOffline.className = "node-offline"
|
|
||||||
iconOffline = L.icon(iconOffline)
|
|
||||||
|
|
||||||
var iconNew = Object.assign({}, iconBase)
|
|
||||||
iconNew.className = "node-new"
|
|
||||||
iconNew = L.icon(iconNew)
|
|
||||||
|
|
||||||
var iconOfflineAlert = Object.assign({}, iconBase)
|
|
||||||
iconOfflineAlert.className = "node-offline node-alert"
|
|
||||||
iconOfflineAlert = L.icon(iconOfflineAlert)
|
|
||||||
|
|
||||||
return function (sidebar) {
|
return function (sidebar) {
|
||||||
var self = this
|
var self = this
|
||||||
@ -98,10 +75,7 @@ define(function () {
|
|||||||
if (d.flags.online)
|
if (d.flags.online)
|
||||||
return iconNew
|
return iconNew
|
||||||
|
|
||||||
if (d.lastseen.isAfter(moment(now).subtract(1, 'days')))
|
return iconOffline
|
||||||
return iconOfflineAlert
|
|
||||||
else
|
|
||||||
return iconOffline
|
|
||||||
}, gotoAnything))
|
}, gotoAnything))
|
||||||
|
|
||||||
var onlinemarkers = subtract(onlinenodes.filter(has_location), newnodes)
|
var onlinemarkers = subtract(onlinenodes.filter(has_location), newnodes)
|
||||||
|
Loading…
Reference in New Issue
Block a user