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(e.latlng.lat));
- $('#home_lon').val(toZoom(e.latlng.lng));
+ $('#home_lat').val(location.lat.toFixed(precision));
+ $('#home_lon').val(location.lng.toFixed(precision));
marker.setLatLng(e.latlng);
marker.addTo(map);