X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/f65593651f17f1bb2caa6a757ca377c094ea7a02..f1ca64ff84ee66de0fde80ed437e837a79a6e4d8:/app/assets/javascripts/index/directions-endpoint.js diff --git a/app/assets/javascripts/index/directions-endpoint.js b/app/assets/javascripts/index/directions-endpoint.js index b9a4ff9a2..14c91a4fb 100644 --- a/app/assets/javascripts/index/directions-endpoint.js +++ b/app/assets/javascripts/index/directions-endpoint.js @@ -17,7 +17,7 @@ OSM.DirectionsEndpoint = function Endpoint(map, input, iconUrl, dragCallback, ge endpoint.marker.on("drag dragend", function (e) { var latlng = e.target.getLatLng(); - endpoint.setLatLng(latlng); + setLatLng(latlng); setInputValueFromLatLng(latlng); endpoint.value = input.val(); dragCallback(e.type === "drag"); @@ -40,7 +40,7 @@ OSM.DirectionsEndpoint = function Endpoint(map, input, iconUrl, dragCallback, ge input.val(value); if (latlng) { - endpoint.setLatLng(latlng); + setLatLng(latlng); setInputValueFromLatLng(latlng); } else { endpoint.getGeocode(); @@ -67,7 +67,7 @@ OSM.DirectionsEndpoint = function Endpoint(map, input, iconUrl, dragCallback, ge return; } - endpoint.setLatLng(L.latLng(json[0])); + setLatLng(L.latLng(json[0])); input.val(json[0].display_name); @@ -75,13 +75,13 @@ OSM.DirectionsEndpoint = function Endpoint(map, input, iconUrl, dragCallback, ge }); }; - endpoint.setLatLng = function (ll) { + function setLatLng(ll) { endpoint.hasGeocode = true; endpoint.latlng = ll; endpoint.marker .setLatLng(ll) .addTo(map); - }; + } function setInputValueFromLatLng(latlng) { var precision = OSM.zoomPrecision(map.getZoom());