From f1ca64ff84ee66de0fde80ed437e837a79a6e4d8 Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Sun, 11 Aug 2024 05:31:48 +0300 Subject: [PATCH] Make setLatLng a private function --- app/assets/javascripts/index/directions-endpoint.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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()); -- 2.39.5