]> git.openstreetmap.org Git - rails.git/commitdiff
Update history feed URL with bbox parameter
authorJohn Firebaugh <john.firebaugh@gmail.com>
Tue, 3 Dec 2013 19:51:37 +0000 (11:51 -0800)
committerTom Hughes <tom@compton.nu>
Tue, 3 Dec 2013 20:12:10 +0000 (20:12 +0000)
https://lists.openstreetmap.org/pipermail/dev/2013-December/027599.html

app/assets/javascripts/index/history.js

index db342cc24cf846ef30ddf1da48f96be1d6f08bc1..dfec793f6494c6cf219f1b0c2bd8bf1526134913 100644 (file)
@@ -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");