<p><b>@HolgerJeromin</b> commented on this pull request.</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2521#discussion_r370989660">app/assets/javascripts/index/directions.js</a>:</p>
<pre style='color:#555'>> @@ -142,12 +142,20 @@ OSM.Directions = function (map) {
$(".directions_form .reverse_directions").on("click", function () {
var from = endpoints[0].latlng,
- to = endpoints[1].latlng;
+ to = endpoints[1].latlng,
+ routeFrom = "",
+ routeTo = "";
+ if (from) {
+ routeFrom = from.lat + "," + from.lng;
+ }
+ if (to) {
+ routeTo = to.lat + "," + to.lng;
+ }
OSM.router.route("/directions?" + querystring.stringify({
from: $("#route_to").val(),
to: $("#route_from").val(),
</pre>
<p>We probably should rename the variables if they are too confusing here. But I wanted a minimal fix in the first place.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2521?email_source=notifications&email_token=AAK2OLP7Q4EQFCVP5ZYUM6DQ7VTZHA5CNFSM4KLWABMKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCTB3VXY#discussion_r370989660">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLO7GZ65FCOQH4NTXB3Q7VTZHANCNFSM4KLWABMA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AAK2OLK7GZ2Q4UUGELOEUJTQ7VTZHA5CNFSM4KLWABMKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCTB3VXY.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/2521?email_source=notifications\u0026email_token=AAK2OLP7Q4EQFCVP5ZYUM6DQ7VTZHA5CNFSM4KLWABMKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCTB3VXY#discussion_r370989660",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/2521?email_source=notifications\u0026email_token=AAK2OLP7Q4EQFCVP5ZYUM6DQ7VTZHA5CNFSM4KLWABMKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCTB3VXY#discussion_r370989660",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>