X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/8024ad919c4ff4c0249d653ee3626a4b38942f3a..a2527b79ff226c2ea7d5fc91552202a98e143bf1:/app/assets/javascripts/index/directions.js.erb diff --git a/app/assets/javascripts/index/directions.js.erb b/app/assets/javascripts/index/directions.js.erb index 93767612b..d18fba65b 100644 --- a/app/assets/javascripts/index/directions.js.erb +++ b/app/assets/javascripts/index/directions.js.erb @@ -55,12 +55,13 @@ OSM.Directions = function (map) { // make text the same in both text boxes var value = e.target.value; endpoint.setValue(value) - endpoint.getGeocode(); }); endpoint.setValue = function(value) { endpoint.value = value; + delete endpoint.latlng; input.val(value); + endpoint.getGeocode(); } endpoint.getGeocode = function() { @@ -338,6 +339,10 @@ OSM.Directions = function (map) { if (params.from) { endpoints[0].setValue(params.from); + endpoints[1].setValue(""); + } else { + endpoints[0].setValue(""); + endpoints[1].setValue(""); } var o = route[0] && L.latLng(route[0].split(',')),