don't fail when newnodes and lostnodes are empty

This commit is contained in:
Nils Schneider 2015-03-22 00:20:06 +01:00
parent 5670ac9e1f
commit a28a1403c6
1 changed files with 7 additions and 1 deletions

View File

@ -235,7 +235,13 @@ function mkmap(map, newnodes, lostnodes, onlinenodes, graph, showNodeinfo, showL
var group = L.featureGroup(markers).addTo(map)
var group_online = L.featureGroup(onlinemarkers).addTo(map)
map.fitBounds(group.getBounds(), {paddingTopLeft: [getSidebarWidth(), 0]})
var bounds = group.getBounds()
if (!bounds.isValid())
bounds = group_online.getBounds()
if (bounds.isValid())
map.fitBounds(bounds, {paddingTopLeft: [getSidebarWidth(), 0]})
var funcDict = {}