Update user location setting for zoomPrecision change

This commit is contained in:
Tom Hughes 2013-08-04 12:40:20 +01:00
parent f9d714dfd3
commit 58eb17cb63

View file

@ -24,12 +24,12 @@ $(document).ready(function () {
map.on("click", function (e) { map.on("click", function (e) {
if ($('#updatehome').is(':checked')) { if ($('#updatehome').is(':checked')) {
var zoom = map.getZoom(), var zoom = map.getZoom(),
toZoom = zoomPrecision(zoom), precision = zoomPrecision(zoom),
location = e.latlng.wrap(); location = e.latlng.wrap();
$('#homerow').removeClass(); $('#homerow').removeClass();
$('#home_lat').val(toZoom(location.lat)); $('#home_lat').val(location.lat.toFixed(precision));
$('#home_lon').val(toZoom(location.lng)); $('#home_lon').val(location.lng.toFixed(precision));
marker.setLatLng(e.latlng); marker.setLatLng(e.latlng);
marker.addTo(map); marker.addTo(map);