Skip to content

Commit

Permalink
Always report the scheme as XYZ
Browse files Browse the repository at this point in the history
Sources with TMS schemes are transparently transformed into XYZ
coordinates.
  • Loading branch information
mojodna committed Oct 22, 2015
1 parent 9cef576 commit 1ca2f50
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/tilejson.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,11 @@ TileJSON.findID = function(filepath, id, callback) {

TileJSON.prototype.getInfo = function(callback) {
if (!this.data) callback(new Error('Tilesource not loaded'));
else callback(null, this.data);
else {
// prepareURL transforms so that coordinates are always output as XYZ
this.data.scheme = 'xyz';
callback(null, this.data);
}
};

// z, x, y are XYZ coordinates.
Expand Down
8 changes: 8 additions & 0 deletions test/tilejson.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,14 @@ tape('findID', function(assert) {
assert.end();
});
});

tape('should set scheme as xyz', function(assert) {
grid_source.getInfo(function(err, info) {
if (err) throw err;
assert.equal('xyz', info.scheme);
assert.end();
});
});
})();

(function() {
Expand Down

0 comments on commit 1ca2f50

Please sign in to comment.