zoom/pan to route when it doesn't fit on the screen

This commit is contained in:
DennisSchiefer
2012-07-03 13:37:12 +01:00
parent 232409d70b
commit d88baaf1a4
2 changed files with 49 additions and 0 deletions
+2
View File
@@ -71,6 +71,8 @@ showRoute: function(response) {
OSRM.Routing._snapRoute();
}
OSRM.Routing._updateHints(response);
var bounds = new L.LatLngBounds( OSRM.G.route._current_route.getPositions() );
OSRM.G.map.setViewBoundsUI(bounds);
},
showRoute_Dragging: function(response) {
if(!response)