map: show client labels
This commit is contained in:
parent
139e3c1a32
commit
e09ec32d93
2 changed files with 82 additions and 2 deletions
14
lib/map.js
14
lib/map.js
|
|
@ -1,6 +1,7 @@
|
|||
define(["map/clientlayer", "d3", "leaflet", "moment", "locationmarker",
|
||||
define(["map/clientlayer", "map/labelslayer",
|
||||
"d3", "leaflet", "moment", "locationmarker",
|
||||
"leaflet.label", "leaflet.providers"],
|
||||
function (ClientLayer, d3, L, moment, LocationMarker) {
|
||||
function (ClientLayer, LabelsLayer, d3, L, moment, LocationMarker) {
|
||||
var options = { worldCopyJump: true,
|
||||
zoomControl: false
|
||||
}
|
||||
|
|
@ -220,6 +221,10 @@ define(["map/clientlayer", "d3", "leaflet", "moment", "locationmarker",
|
|||
clientLayer.addTo(map)
|
||||
clientLayer.setZIndex(5)
|
||||
|
||||
var labelsLayer = new LabelsLayer({minZoom: 15})
|
||||
labelsLayer.addTo(map)
|
||||
labelsLayer.setZIndex(6)
|
||||
|
||||
var nodeDict = {}
|
||||
var linkDict = {}
|
||||
var highlight
|
||||
|
|
@ -345,6 +350,11 @@ define(["map/clientlayer", "d3", "leaflet", "moment", "locationmarker",
|
|||
groupLost = L.featureGroup(markersLost).addTo(map)
|
||||
|
||||
clientLayer.setData(data.nodes.all.filter(online).filter(has_location))
|
||||
labelsLayer.setData({online: nodesOnline.filter(has_location),
|
||||
offline: nodesOffline.filter(has_location),
|
||||
new: data.nodes.new.filter(has_location),
|
||||
lost: data.nodes.lost.filter(has_location)
|
||||
})
|
||||
|
||||
updateView(true)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue