- map.events.register("click", map, function (e) {
- closeMapPopup();
-
- if (document.getElementById('updatehome').checked) {
- var lonlat = getEventPosition(e);
+ map.on("click", function (e) {
+ if ($('#updatehome').is(':checked')) {
+ var zoom = map.getZoom(),
+ precision = zoomPrecision(zoom),
+ location = e.latlng.wrap();