rename gotoAnything to router

This commit is contained in:
Nils Schneider 2015-03-25 19:45:21 +01:00
commit 265cb2e5eb
7 changed files with 39 additions and 39 deletions

View file

@ -2,7 +2,7 @@ define(function () {
var options = { worldCopyJump: true,
zoomControl: false
}
function mkMarker(dict, iconFunc, gotoAnything) {
function mkMarker(dict, iconFunc, router) {
return function (d) {
var m = L.circleMarker([d.nodeinfo.location.latitude, d.nodeinfo.location.longitude], iconFunc(d))
@ -10,7 +10,7 @@ define(function () {
m.setStyle(iconFunc(d))
}
m.on('click', gotoAnything.node(d, false))
m.on('click', router.node(d, false))
m.bindLabel(d.nodeinfo.hostname)
dict[d.nodeinfo.node_id] = m
@ -19,7 +19,7 @@ define(function () {
}
}
function addLinksToMap(dict, linkScale, graph, gotoAnything) {
function addLinksToMap(dict, linkScale, graph, router) {
graph = graph.filter( function (d) {
return "distance" in d
})
@ -38,7 +38,7 @@ define(function () {
}
line.bindLabel(d.source.node.nodeinfo.hostname + " " + d.target.node.nodeinfo.hostname + "<br><strong>" + showDistance(d) + " / " + showTq(d) + "</strong>")
line.on('click', gotoAnything.link(d, false))
line.on('click', router.link(d, false))
dict[linkId(d)] = line
@ -55,7 +55,7 @@ define(function () {
var groupOnline, group
return function (linkScale, sidebar, gotoAnything) {
return function (linkScale, sidebar, router) {
var self = this
var el = document.createElement("div")
@ -80,7 +80,7 @@ define(function () {
nodeDict = {}
linkDict = {}
var lines = addLinksToMap(linkDict, linkScale, links, gotoAnything)
var lines = addLinksToMap(linkDict, linkScale, links, router)
var nodes = newnodes.concat(lostnodes).filter(has_location)
@ -92,10 +92,10 @@ define(function () {
return iconAlert
return iconOffline
}, gotoAnything))
}, router))
var onlinemarkers = subtract(onlinenodes.filter(has_location), newnodes)
.map(mkMarker(nodeDict, function (d) { return iconOnline }, gotoAnything))
.map(mkMarker(nodeDict, function (d) { return iconOnline }, router))
var groupLines = L.featureGroup(lines).addTo(map)
groupOnline = L.featureGroup(onlinemarkers).addTo(map)