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