add a basic TileSet class

This commit is contained in:
Éric Lemoine
2012-06-19 15:18:34 +02:00
parent 79af86bde5
commit 1c8abd38a6
4 changed files with 50 additions and 0 deletions

View File

@@ -5,3 +5,4 @@ goog.require("ol.loc");
goog.require("ol.projection");
goog.require("ol.Tile");
goog.require("ol.TileSet");

40
src/ol/TileSet.js Normal file
View File

@@ -0,0 +1,40 @@
goog.provide('ol.TileSet');
/**
* The TileSet class. A TileSet instance represents a collection of
* tiles. Tiles of a TileSet have the same resolution, width and
* height.
* @constructor
*/
ol.TileSet = function() {
/**
* @private
* @type {number|undefined}
*/
this.resolution_ = undefined;
/**
* @private
* @type {number|undefined}
*/
this.bounds_ = undefined;
/**
* @private
* @type {number|undefined}
*/
this.tileWidth_ = undefined;
/**
* @private
* @type {number|undefined}
*/
this.tileHeight_ = undefined;
/**
* @private
* @type {Array.<ol.Tile>|undefined}
*/
this.tiles_ = undefined;
};

View File

@@ -17,6 +17,7 @@
<script type="text/javascript" src="spec/ol/Map.test.js"></script>
<script type="text/javascript" src="spec/ol/Projection.test.js"></script>
<script type="text/javascript" src="spec/ol/Tile.test.js"></script>
<script type="text/javascript" src="spec/ol/TileSet.test.js"></script>
<script type="text/javascript">
(function() {

View File

@@ -0,0 +1,8 @@
describe("ol.TileSet", function() {
describe("creating a tileset", function() {
it("creates a tileset instance", function() {
var tileset = new ol.TileSet();
expect(tileset instanceof ol.TileSet).toBe(true);
});
});
});