X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/f3afd4307685b49f7644d074ee27f88b086734f1..330ddc166653df732fc14ec26071c8a5d0cca292:/app/assets/javascripts/index.js diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index 9a05ae1dd..616402811 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -17,7 +17,7 @@ $(document).ready(function () { map.zoomToExtent(proj(bbox)); if (params.box) { - $(window).load(function() { addBoxToMap(bbox) }); + addBoxToMap(bbox); } } else { setMapCenter(new OpenLayers.LonLat(params.lon, params.lat), params.zoom); @@ -33,13 +33,7 @@ $(document).ready(function () { } if (params.object) { - var url = "/api/" + OSM.API_VERSION + "/" + params.object_type + "/" + params.object_id; - - if (params.object_type != "node") { - url += "/full"; - } - - $(window).load(function() { addObjectToMap(url, params.object_zoom) }); + addObjectToMap(params.object, params.object_zoom); } handleResize(); @@ -79,7 +73,7 @@ $(document).ready(function () { var extents = unproj(map.getExtent()); var expiry = new Date(); - updatelinks(lonlat.lon, lonlat.lat, zoom, layers, extents.left, extents.bottom, extents.right, extents.top, params.object_type, params.object_id); + updatelinks(lonlat.lon, lonlat.lat, zoom, layers, extents.left, extents.bottom, extents.right, extents.top, params.object); expiry.setYear(expiry.getFullYear() + 10); $.cookie("_osm_location", [lonlat.lon, lonlat.lat, zoom, layers].join("|"), {expires: expiry});