diff --git a/app/assets/javascripts/index/directions-endpoint.js b/app/assets/javascripts/index/directions-endpoint.js index 24042081d..ec09352de 100644 --- a/app/assets/javascripts/index/directions-endpoint.js +++ b/app/assets/javascripts/index/directions-endpoint.js @@ -61,7 +61,6 @@ OSM.DirectionsEndpoint = function Endpoint(map, input, iconUrl, dragCallback, ch $.getJSON(OSM.NOMINATIM_URL + "search?q=" + encodeURIComponent(endpoint.value) + "&format=json&viewbox=" + viewbox, function (json) { endpoint.awaitingGeocode = false; - endpoint.hasGeocode = true; if (json.length === 0) { input.addClass("is-invalid"); alert(I18n.t("javascripts.directions.errors.no_place", { place: endpoint.value })); @@ -77,7 +76,6 @@ OSM.DirectionsEndpoint = function Endpoint(map, input, iconUrl, dragCallback, ch }; function setLatLng(ll) { - endpoint.hasGeocode = true; endpoint.latlng = ll; endpoint.marker .setLatLng(ll) diff --git a/app/assets/javascripts/index/directions.js b/app/assets/javascripts/index/directions.js index b34f18ed1..0f3c410f7 100644 --- a/app/assets/javascripts/index/directions.js +++ b/app/assets/javascripts/index/directions.js @@ -119,18 +119,6 @@ OSM.Directions = function (map) { // 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;