Skip to content

Instantly share code, notes, and snippets.

@tmcw
Created April 13, 2015 23:05
Show Gist options
  • Save tmcw/7819223a348ff2907b13 to your computer and use it in GitHub Desktop.
Save tmcw/7819223a348ff2907b13 to your computer and use it in GitHub Desktop.
function joiner(data, joinRules) {
return function(tile) {
if (shouldJoin(joinRules, tile, data)) {
return joinData(joinRules, tile, data);
}
}
}
var countryJoiner(someData, ['country', '=', 'country']);
map.getSource('foo').addPipe(function(tile, callback) {
callback(countryJoiner(tile)) || tile)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment