Fix listener notification when no bbox is set

before-bootstrap
Candid Dauth 2016-03-19 12:31:27 +01:00
rodzic d60316f832
commit 6874c34761
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -337,7 +337,7 @@ function _setLinePoints(padId, lineId, points, callback) {
return callback(err);
listeners.notifyPadListeners(padId, "linePoints", function(bboxWithZoom) {
return { reset: true, id: lineId, points : routing.prepareForBoundingBox(points, bboxWithZoom) };
return { reset: true, id: lineId, points : (bboxWithZoom ? routing.prepareForBoundingBox(points, bboxWithZoom) : [ ]) };
});
callback(null);
@ -465,7 +465,7 @@ function _calculateRouting(line, callback) {
function _getMarkerDataFunc(marker) {
return function(bbox) {
if(!utils.isInBbox(marker, bbox))
if(!bbox || !utils.isInBbox(marker, bbox))
return null;
return marker;