From 6053ed41242448b286cae2b14126add52ea07fb5 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Tue, 3 Dec 2013 11:51:37 -0800 Subject: [PATCH] Update history feed URL with bbox parameter https://lists.openstreetmap.org/pipermail/dev/2013-December/027599.html --- app/assets/javascripts/index/history.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/index/history.js b/app/assets/javascripts/index/history.js index db342cc24..dfec793f6 100644 --- a/app/assets/javascripts/index/history.js +++ b/app/assets/javascripts/index/history.js @@ -46,7 +46,7 @@ OSM.History = function(map) { $("#changeset_" + id).find("a.changeset_id").simulate("click", e); } - function loadData() { + function update() { var data = {list: '1'}; if (window.location.pathname === '/history') { @@ -62,6 +62,11 @@ OSM.History = function(map) { updateMap(); } }); + + var feedLink = $('link[type="application/atom+xml"]'), + feedHref = feedLink.attr('href').split('?')[0]; + + feedLink.attr('href', feedHref + '?bbox=' + data.bbox); } function loadMore(e) { @@ -121,17 +126,17 @@ OSM.History = function(map) { map.addLayer(group); if (window.location.pathname === '/history') { - map.on("moveend", loadData) + map.on("moveend", update) } - loadData(); + update(); }; page.unload = function() { map.removeLayer(group); if (window.location.pathname === '/history') { - map.off("moveend", loadData) + map.off("moveend", update) } $("#history_tab").removeClass("current"); -- 2.43.2