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) {
if ($('#updatehome').is(':checked')) {
var zoom = map.getZoom(),
toZoom = zoomPrecision(zoom),
precision = zoomPrecision(zoom),
location = e.latlng.wrap();
$('#homerow').removeClass();
$('#home_lat').val(toZoom(location.lat));
$('#home_lon').val(toZoom(location.lng));
$('#home_lat').val(location.lat.toFixed(precision));
$('#home_lon').val(location.lng.toFixed(precision));
marker.setLatLng(e.latlng);
marker.addTo(map);