]> git.openstreetmap.org Git - rails.git/commitdiff
Merge remote-tracking branch 'upstream/pull/5095'
authorTom Hughes <tom@compton.nu>
Tue, 20 Aug 2024 11:18:47 +0000 (12:18 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 20 Aug 2024 11:18:47 +0000 (12:18 +0100)
app/assets/javascripts/index/directions-endpoint.js

index 8489dd6df1780d50ea281e3acfdf01e1866ce0a6..9ae7ce84fff948bbf4a7303bfc07f794dc617e77 100644 (file)
@@ -68,6 +68,7 @@ OSM.DirectionsEndpoint = function Endpoint(map, input, iconUrl, dragCallback, ch
     var viewbox = map.getBounds().toBBoxString(); // <sw lon>,<sw lat>,<ne lon>,<ne lat>
     var geocodeUrl = OSM.NOMINATIM_URL + "search?q=" + encodeURIComponent(endpoint.value) + "&format=json&viewbox=" + viewbox;
 
+    if (endpoint.geocodeRequest) endpoint.geocodeRequest.abort();
     endpoint.geocodeRequest = $.getJSON(geocodeUrl, function (json) {
       delete endpoint.geocodeRequest;
       if (json.length === 0) {