From: Tom Hughes Date: Sun, 18 Aug 2024 11:16:22 +0000 (+0100) Subject: Merge remote-tracking branch 'upstream/pull/5083' X-Git-Tag: live~741 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/41b81bd393cafe8fb0d25ccdc3afb08fb695bb52?ds=sidebyside;hp=-c Merge remote-tracking branch 'upstream/pull/5083' --- 41b81bd393cafe8fb0d25ccdc3afb08fb695bb52 diff --combined app/assets/javascripts/index/directions.js index e2cdd3a54,0f3c410f7..3f78c7089 --- a/app/assets/javascripts/index/directions.js +++ b/app/assets/javascripts/index/directions.js @@@ -75,8 -75,12 +75,8 @@@ OSM.Directions = function (map) $(".directions_form .btn-close").on("click", function (e) { e.preventDefault(); - var route_from = endpoints[0].value; - if (route_from) { - OSM.router.route("/?query=" + encodeURIComponent(route_from) + OSM.formatHash(map)); - } else { - OSM.router.route("/" + OSM.formatHash(map)); - } + $(".search_form input[name='query']").val(endpoints[0].value); + OSM.router.route("/" + OSM.formatHash(map)); }); function formatDistance(m) { @@@ -115,18 -119,6 +115,6 @@@ // Cancel any route that is already in progress if (routeRequest) routeRequest.abort(); - // go fetch geocodes for any endpoints which have not already - // been geocoded. - for (var ep_i = 0; ep_i < 2; ++ep_i) { - var endpoint = endpoints[ep_i]; - if (!endpoint.hasGeocode && !endpoint.awaitingGeocode) { - endpoint.getGeocode(); - } - } - if (endpoints[0].awaitingGeocode || endpoints[1].awaitingGeocode) { - return; - } - var o = endpoints[0].latlng, d = endpoints[1].latlng;