From: Tom Hughes Date: Tue, 30 Jul 2013 17:05:57 +0000 (+0100) Subject: Round user home location to a sensible precision X-Git-Tag: live~5438 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/b1dae2e7988d5e808b1716eb331d359575e829e5 Round user home location to a sensible precision --- diff --git a/app/assets/javascripts/user.js b/app/assets/javascripts/user.js index 86a30958b..b4dbb7de2 100644 --- a/app/assets/javascripts/user.js +++ b/app/assets/javascripts/user.js @@ -23,9 +23,12 @@ $(document).ready(function () { map.on("click", function (e) { if ($('#updatehome').is(':checked')) { + var zoom = map.getZoom(), + toZoom = zoomPrecision(zoom); + $('#homerow').removeClass(); - $('#home_lat').val(e.latlng.lat); - $('#home_lon').val(e.latlng.lng); + $('#home_lat').val(toZoom(e.latlng.lat)); + $('#home_lon').val(toZoom(e.latlng.lng)); marker.setLatLng(e.latlng); marker.addTo(map);