From: Tom Hughes Date: Wed, 18 Mar 2020 20:15:06 +0000 (+0000) Subject: Merge remote-tracking branch 'upstream/pull/2548' X-Git-Tag: live~3284 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/e89742928ddccbe127955f94be4be61e13f1faed?hp=eec9e29c963bc20e4e968d5aefd7cc22ca1cbeba Merge remote-tracking branch 'upstream/pull/2548' --- diff --git a/app/assets/javascripts/index/directions.js b/app/assets/javascripts/index/directions.js index 1c095a36b..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({