X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/330ddc166653df732fc14ec26071c8a5d0cca292..352d9365e4c2a70756d3cd2f14530a7f71201c36:/app/assets/javascripts/user.js diff --git a/app/assets/javascripts/user.js b/app/assets/javascripts/user.js index 7d8c2f334..77cb86a8d 100644 --- a/app/assets/javascripts/user.js +++ b/app/assets/javascripts/user.js @@ -1,19 +1,20 @@ $(document).ready(function () { - var params = $("#map").data(); var map = createMap("map"); - setMapCenter(new OpenLayers.LonLat(params.lon, params.lat), params.zoom); + if (OSM.home) { + setMapCenter(new OpenLayers.LonLat(OSM.home.lon, OSM.home.lat), 12); + } else { + setMapCenter(new OpenLayers.LonLat(0, 0), 0); + } if ($("#map").hasClass("set_location")) { var marker; - if (params.marker) { - marker = addMarkerToMap(new OpenLayers.LonLat(params.lon, params.lat)); + if (OSM.home) { + marker = addMarkerToMap(new OpenLayers.LonLat(OSM.home.lon, OSM.home.lat)); } map.events.register("click", map, function (e) { - closeMapPopup(); - if ($('#updatehome').is(':checked')) { var lonlat = getEventPosition(e); @@ -29,8 +30,6 @@ $(document).ready(function () { } }); } else { - addMarkerToMap(new OpenLayers.LonLat(params.lon, params.lat), null, params.marker.description); - $("[data-user]").each(function () { var user = $(this).data('user'); if (user.lon && user.lat) {