Add EMPTY tile state instead of using null for empty tiles

This commit is contained in:
Tom Payne
2013-03-08 14:41:14 +01:00
parent 0a13344668
commit b729f969a7
9 changed files with 37 additions and 42 deletions

View File

@@ -220,12 +220,9 @@ goog.inherits(ol.test.source.MockTileSource, ol.source.TileSource);
* @inheritDoc
*/
ol.test.source.MockTileSource.prototype.getTile = function(tileCoord) {
var tile = new ol.Tile(tileCoord);
var key = tileCoord.toString();
if (this.loaded_[key]) {
tile.state = ol.TileState.LOADED;
}
return tile;
var tileState = this.loaded_[key] ? ol.TileState.LOADED : ol.TileState.IDLE;
return new ol.Tile(tileCoord, tileState);
};