diff --git a/src/ol/TileSet.js b/src/ol/TileSet.js index 4f20c1208f..56c8f3885b 100644 --- a/src/ol/TileSet.js +++ b/src/ol/TileSet.js @@ -20,23 +20,47 @@ ol.TileSet = function(tiles, tileWidth, tileHeight, resolution) { /** * @private - * @type {number|undefined} + * @type {number} */ this.tileWidth_ = tileWidth; /** * @private - * @type {number|undefined} + * @type {number} */ this.tileHeight_ = tileHeight; /** * @private - * @type {number|undefined} + * @type {number} */ this.resolution_ = resolution; }; +/** + * @return {Array.>} + */ ol.TileSet.prototype.getTiles = function() { return this.tiles_; }; + +/** + * @return {number} + */ +ol.TileSet.prototype.getResolution = function() { + return this.resolution_; +}; + +/** + * @return {number} + */ +ol.TileSet.prototype.getTileHeight = function() { + return this.tileHeight_; +}; + +/** + * @return {number} + */ +ol.TileSet.prototype.getTileWidth = function() { + return this.tileWidth_; +}; diff --git a/test/spec/ol/TileSet.test.js b/test/spec/ol/TileSet.test.js index b3d139046a..8fd5798c84 100644 --- a/test/spec/ol/TileSet.test.js +++ b/test/spec/ol/TileSet.test.js @@ -5,4 +5,17 @@ describe("ol.TileSet", function() { expect(tileset).toBeA(ol.TileSet); }); }); + describe("getter methods", function() { + var tileSet = new ol.TileSet([], 123, 456, 10); + + it("allows getting tile width", function() { + expect(tileSet.getTileWidth()).toBe(123); + }); + it("allows getting tile height", function() { + expect(tileSet.getTileHeight()).toBe(456); + }); + it("allows getting resolution", function() { + expect(tileSet.getResolution()).toBe(10); + }); + }); });