diff --git a/src/GeoJson.js b/src/GeoJson.js index 391ddef..8c1d73e 100644 --- a/src/GeoJson.js +++ b/src/GeoJson.js @@ -75,6 +75,7 @@ ms.geoJson = function(fetch) { var g = tile.element = ms.svg("g"); var tileProj = proj(tile); + var context = {zoom: tile.zoom, row: tile.row, column: tile.column}; tile.features = []; @@ -82,7 +83,7 @@ ms.geoJson = function(fetch) { var updated = []; /* Fetch the next batch of features, if so directed. */ - if (data.next) tile.request = fetch(data.next.href, update); + if (data.next) tile.request = fetch(data.next.href, update, {context: context}); if (geoJson.tile() && tileBackground) { var tileSize = geoJson.map().tileSize(); @@ -100,7 +101,7 @@ ms.geoJson = function(fetch) { } if (url != null) { - tile.request = fetch(typeof url == "function" ? url(tile) : url, update); + tile.request = fetch(typeof url == "function" ? url(tile) : url, update, {context: context}); } else { update({type: "FeatureCollection", features: features || []}); } diff --git a/src/TopoJson.js b/src/TopoJson.js index acf9b9a..4875eda 100644 --- a/src/TopoJson.js +++ b/src/TopoJson.js @@ -52,13 +52,13 @@ ms.topoJson = function(fetch) { return features; }; - var topoToGeo = function(url, callback) { + var topoToGeo = function(url, callback, options) { return fetch(url, function(topology) { callback({ type: "FeatureCollection", features: topologyFeatures(topology) }); - }); + }, options); }; var topoJson = ms.geoJson(topoToGeo);