Round user home location to a sensible precision
This commit is contained in:
parent
573c0c848a
commit
b1dae2e798
1 changed files with 5 additions and 2 deletions
|
@ -23,9 +23,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(),
|
||||||
|
toZoom = zoomPrecision(zoom);
|
||||||
|
|
||||||
$('#homerow').removeClass();
|
$('#homerow').removeClass();
|
||||||
$('#home_lat').val(e.latlng.lat);
|
$('#home_lat').val(toZoom(e.latlng.lat));
|
||||||
$('#home_lon').val(e.latlng.lng);
|
$('#home_lon').val(toZoom(e.latlng.lng));
|
||||||
|
|
||||||
marker.setLatLng(e.latlng);
|
marker.setLatLng(e.latlng);
|
||||||
marker.addTo(map);
|
marker.addTo(map);
|
||||||
|
|
Loading…
Add table
Reference in a new issue