1 $(document).ready(function () {
2 var map = createMap("map");
5 setMapCenter(new OpenLayers.LonLat(OSM.home.lon, OSM.home.lat), 12);
7 setMapCenter(new OpenLayers.LonLat(0, 0), 0);
10 if ($("#map").hasClass("set_location")) {
14 marker = addMarkerToMap(new OpenLayers.LonLat(OSM.home.lon, OSM.home.lat));
17 map.events.register("click", map, function (e) {
18 if ($('#updatehome').is(':checked')) {
19 var lonlat = getEventPosition(e);
21 $('#homerow').removeClass();
22 $('#home_lat').val(lonlat.lat);
23 $('#home_lon').val(lonlat.lon);
26 removeMarkerFromMap(marker);
29 marker = addMarkerToMap(lonlat);
33 $("[data-user]").each(function () {
34 var user = $(this).data('user');
35 if (user.lon && user.lat) {
36 var icon = OpenLayers.Marker.defaultIcon();
37 icon.url = OpenLayers.Util.getImageLocation(user.icon);
38 addMarkerToMap(new OpenLayers.LonLat(user.lon, user.lat), icon, user.description);