Skip to content

Commit

Permalink
Merge 1ca2f50 into 9cef576
Browse files Browse the repository at this point in the history
  • Loading branch information
mojodna committed Oct 22, 2015
2 parents 9cef576 + 1ca2f50 commit fe15369
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
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
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 fe15369

Please sign in to comment.