1 $(document).ready(function () {
2 var map = L.map("map", {
3 attributionControl: false,
5 }).addLayer(new L.OSM.Mapnik());
11 map.setView([OSM.home.lat, OSM.home.lon], 12);
13 map.setView([0, 0], 0);
16 if ($("#map").hasClass("set_location")) {
17 var marker = L.marker([0, 0], {icon: getUserIcon()});
20 marker.setLatLng([OSM.home.lat, OSM.home.lon]);
24 map.on("click", function (e) {
25 if ($('#updatehome').is(':checked')) {
26 var zoom = map.getZoom(),
27 toZoom = zoomPrecision(zoom);
29 $('#homerow').removeClass();
30 $('#home_lat').val(toZoom(e.latlng.lat));
31 $('#home_lon').val(toZoom(e.latlng.lng));
33 marker.setLatLng(e.latlng);
38 $("[data-user]").each(function () {
39 var user = $(this).data('user');
40 if (user.lon && user.lat) {
41 L.marker([user.lat, user.lon], {icon: getUserIcon(user.icon)}).addTo(map)
42 .bindPopup(user.description);