From 12fe59d0fd2a3c379a4b06dbae65731671b2d5de Mon Sep 17 00:00:00 2001 From: Krivchikov Dmitry Date: Wed, 2 Jul 2014 15:28:18 +0400 Subject: [PATCH] =?UTF-8?q?FIX=20=D1=82=D0=BE=D1=87=D0=BA=D0=B8=20=D0=BC?= =?UTF-8?q?=D0=B0=D1=80=D1=88=D1=80=D1=83=D1=82=D0=B0=20=D0=B2=20=D1=83?= =?UTF-8?q?=D1=80=D0=BB=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/js/route.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/public/js/route.js b/public/js/route.js index 23dd2e1..1c590dc 100644 --- a/public/js/route.js +++ b/public/js/route.js @@ -30,6 +30,11 @@ function buildRoute(fit) wayPoints.push({latLng: points[$(el).attr('pointId')]._latlng}); }); + if (fit === true) + { + myMap.fitBounds(bounds).zoomOut(); + } + if (wayPoints.length > 1) { L.Routing.osrm().route(wayPoints, function(err, routes) { @@ -50,15 +55,9 @@ function buildRoute(fit) route.addTo(myMap); } }); - - if (fit === true) - { - closeBox(); - myMap.fitBounds(bounds).zoomOut(); - } - - routeToURL(); } + + routeToURL(); } /**