map: show client labels

This commit is contained in:
Nils Schneider 2015-04-17 23:54:19 +02:00
commit e09ec32d93
2 changed files with 82 additions and 2 deletions

View file

@ -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)
}