From 25310ff1bdd1646b08475508ae87d41cf9f06018 Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Sun, 15 Apr 2012 19:31:49 +0200 Subject: [PATCH] corrected error in via computation when no road was visible --- WebContent/OSRM.Via.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebContent/OSRM.Via.js b/WebContent/OSRM.Via.js index 0b307de7d..ac92ecf3e 100644 --- a/WebContent/OSRM.Via.js +++ b/WebContent/OSRM.Via.js @@ -80,7 +80,7 @@ drawDragMarker: function(event) { // get distance to route var minpoint = OSRM.G.route._current_route.route.closestLayerPoint( event.layerPoint ); - var min_dist = minpoint._sqDist; + var min_dist = minpoint ? minpoint._sqDist : 1000; // get distance to markers var mouse = event.latlng;