1 $(document).ready(function () {
2 var map = L.map("map", {
3 attributionControl: false,
5 }).addLayer(new L.OSM.Mapnik());
7 L.control.zoom({position: 'topright'})
10 $("#map").on("resized", function () {
15 map.setView([OSM.home.lat, OSM.home.lon], 12);
17 map.setView([0, 0], 0);
20 if ($("#map").hasClass("set_location")) {
21 var marker = L.marker([0, 0], {icon: getUserIcon()});
24 marker.setLatLng([OSM.home.lat, OSM.home.lon]);
28 map.on("click", function (e) {
29 if ($('#updatehome').is(':checked')) {
30 $('#homerow').removeClass();
31 $('#home_lat').val(e.latlng.lat);
32 $('#home_lon').val(e.latlng.lng);
34 marker.setLatLng(e.latlng);
39 $("[data-user]").each(function () {
40 var user = $(this).data('user');
41 if (user.lon && user.lat) {
42 L.marker([user.lat, user.lon], {icon: getUserIcon(user.icon)}).addTo(map)
43 .bindPopup(user.description);