X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/a32f4c231e678dd02a4728355455547d3d20fe2a..bf9dd8f350ca1b54afb79dda79506d980ccb5738:/app/assets/javascripts/index/directions.js diff --git a/app/assets/javascripts/index/directions.js b/app/assets/javascripts/index/directions.js index 5f822b472..5f9027ec6 100644 --- a/app/assets/javascripts/index/directions.js +++ b/app/assets/javascripts/index/directions.js @@ -141,15 +141,15 @@ OSM.Directions = function (map) { } $(".directions_form .reverse_directions").on("click", function () { - var from = endpoints[0].latlng, - to = endpoints[1].latlng, + var coordFrom = endpoints[0].latlng, + coordTo = endpoints[1].latlng, routeFrom = "", routeTo = ""; - if(from){ - routeFrom = from.lat + "," + from.lng; + if (coordFrom) { + routeFrom = coordFrom.lat + "," + coordFrom.lng; } - if(to){ - routeTo = to.lat + "," + to.lng; + if (coordTo) { + routeTo = coordTo.lat + "," + coordTo.lng; } OSM.router.route("/directions?" + querystring.stringify({