X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/97eee60c99d41057ff72c6b1d5835e89107158d9..5cb9f2b022ba1c829ae5f4d980f27c7aad694ff6:/app/assets/javascripts/user.js diff --git a/app/assets/javascripts/user.js b/app/assets/javascripts/user.js index 384dba93f..77cb86a8d 100644 --- a/app/assets/javascripts/user.js +++ b/app/assets/javascripts/user.js @@ -1,14 +1,17 @@ $(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) { @@ -27,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) {