Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/GeoJson.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,15 @@ 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 = [];

function update(data) {
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();
Expand All @@ -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 || []});
}
Expand Down
4 changes: 2 additions & 2 deletions src/TopoJson.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down