1 $(document).ready(function () {
2 var map = createMap("map");
5 map.setView([OSM.home.lat, OSM.home.lon], 12);
7 map.setView([0, 0], 0);
10 if ($("#map").hasClass("set_location")) {
14 marker = addMarkerToMap([OSM.home.lat, OSM.home.lon]);
17 map.on("click", function (e) {
18 if ($('#updatehome').is(':checked')) {
19 $('#homerow').removeClass();
20 $('#home_lat').val(e.latlng.lat);
21 $('#home_lon').val(e.latlng.lng);
24 removeMarkerFromMap(marker);
27 marker = addMarkerToMap(e.latlng);
31 $("[data-user]").each(function () {
32 var user = $(this).data('user');
33 if (user.lon && user.lat) {
34 addMarkerToMap([user.lat, user.lon], L.icon({iconUrl: user.icon}), user.description);