- $.getJSON(OSM.NOMINATIM_URL + "search?q=" + encodeURIComponent(endpoint.value) + "&format=json&viewbox=" + viewbox, function (json) {
- endpoint.awaitingGeocode = false;
+ if (endpoint.geocodeRequest) endpoint.geocodeRequest.abort();
+ endpoint.geocodeRequest = $.getJSON(geocodeUrl, function (json) {
+ delete endpoint.geocodeRequest;