X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/f3afd4307685b49f7644d074ee27f88b086734f1..e316f0e425cc934295c8e64cdcf03f00899f287c:/app/assets/javascripts/index.js diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index 9a05ae1dd..85f5dab0d 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,24 +33,11 @@ $(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(); - $("#show_data").click(function (e) { - $.ajax({ url: $(this).attr('href'), success: function (sidebarHtml) { - startBrowse(sidebarHtml); - }}); - e.preventDefault(); - }); - $("body").on("click", "a.set_position", function () { var data = $(this).data(); var centre = new OpenLayers.LonLat(data.lon, data.lat); @@ -79,7 +66,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}); @@ -114,17 +101,6 @@ $(document).ready(function () { map.setCenter(centre, zoom); }); - $("#exportanchor").click(function (e) { - $.ajax({ url: $(this).data('url'), success: function (sidebarHtml) { - startExport(sidebarHtml); - }}); - e.preventDefault(); - }); - - if (window.location.pathname == "/export") { - $("#exportanchor").click(); - } - $("#search_form").submit(function () { var extent = unproj(map.getExtent());