X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/aafb1db2be953bd854d2a4e9fdab644db00f8958..e44f856b53fcba5b44af37126579a034ef654676:/app/assets/javascripts/index/directions.js diff --git a/app/assets/javascripts/index/directions.js b/app/assets/javascripts/index/directions.js index 1ad7f9cb7..1a3e0d4ec 100644 --- a/app/assets/javascripts/index/directions.js +++ b/app/assets/javascripts/index/directions.js @@ -54,6 +54,8 @@ OSM.Directions = function (map) { }); input.on("change", function (e) { + awaitingGeocode = true; + // make text the same in both text boxes var value = e.target.value; endpoint.setValue(value); @@ -88,12 +90,9 @@ OSM.Directions = function (map) { return; } - input.val(json[0].display_name); + endpoint.setLatLng(L.latLng(json[0])); - endpoint.latlng = L.latLng(json[0]); - endpoint.marker - .setLatLng(endpoint.latlng) - .addTo(map); + input.val(json[0].display_name); if (awaitingGeocode) { awaitingGeocode = false;