Merge branch 'master' of github.com:openlayers/ol3 into vector

This commit is contained in:
Tim Schaub
2013-01-24 22:21:25 -07:00
49 changed files with 1694 additions and 571 deletions
+1
View File
@@ -2,6 +2,7 @@ goog.provide('ol.BingMapsStyle');
goog.provide('ol.source.BingMaps');
goog.require('goog.Uri');
goog.require('goog.array');
goog.require('goog.events');
goog.require('goog.events.EventType');
goog.require('goog.net.Jsonp');
+1
View File
@@ -0,0 +1 @@
@exportClass ol.source.DebugTileSource ol.source.DebugTileSourceOptions
+22 -16
View File
@@ -1,8 +1,8 @@
goog.provide('ol.source.DebugTileSource');
goog.provide('ol.source.DebugTileSourceOptions');
goog.require('ol.Size');
goog.require('ol.Tile');
goog.require('ol.TileCache');
goog.require('ol.TileCoord');
goog.require('ol.source.TileSource');
goog.require('ol.tilegrid.TileGrid');
@@ -79,14 +79,6 @@ ol.DebugTile_.prototype.getImage = function(opt_context) {
};
/**
* @typedef {{extent: (ol.Extent|undefined),
* projection: (ol.Projection|undefined),
* tileGrid: (ol.tilegrid.TileGrid|undefined)}}
*/
ol.source.DebugTileSourceOptions;
/**
* @constructor
@@ -103,26 +95,40 @@ ol.source.DebugTileSource = function(options) {
/**
* @private
* @type {Object.<string, ol.DebugTile_>}
* FIXME will need to expire elements from this cache
* FIXME see elemoine's work with goog.structs.LinkedMap
* @type {ol.TileCache}
*/
this.tileCache_ = {};
this.tileCache_ = new ol.TileCache();
};
goog.inherits(ol.source.DebugTileSource, ol.source.TileSource);
/**
* @inheritDoc
*/
ol.source.DebugTileSource.prototype.canExpireCache = function() {
return this.tileCache_.canExpireCache();
};
/**
* @inheritDoc
*/
ol.source.DebugTileSource.prototype.expireCache = function(usedTiles) {
this.tileCache_.expireCache(usedTiles);
};
/**
* @inheritDoc
*/
ol.source.DebugTileSource.prototype.getTile = function(tileCoord) {
var key = tileCoord.toString();
if (goog.object.containsKey(this.tileCache_, key)) {
return this.tileCache_[key];
if (this.tileCache_.containsKey(key)) {
return /** @type {ol.DebugTile_} */ (this.tileCache_.get(key));
} else {
var tile = new ol.DebugTile_(tileCoord, this.tileGrid);
this.tileCache_[key] = tile;
this.tileCache_.set(key, tile);
return tile;
}
};
+22 -7
View File
@@ -5,6 +5,7 @@ goog.require('ol.Attribution');
goog.require('ol.Extent');
goog.require('ol.ImageTile');
goog.require('ol.Projection');
goog.require('ol.TileCache');
goog.require('ol.TileCoord');
goog.require('ol.TileUrlFunction');
goog.require('ol.TileUrlFunctionType');
@@ -55,32 +56,46 @@ ol.source.ImageTileSource = function(options) {
/**
* @private
* @type {Object.<string, ol.ImageTile>}
* FIXME will need to expire elements from this cache
* FIXME see elemoine's work with goog.structs.LinkedMap
* @type {ol.TileCache}
*/
this.tileCache_ = {};
this.tileCache_ = new ol.TileCache();
};
goog.inherits(ol.source.ImageTileSource, ol.source.TileSource);
/**
* @inheritDoc
*/
ol.source.ImageTileSource.prototype.canExpireCache = function() {
return this.tileCache_.canExpireCache();
};
/**
* @inheritDoc
*/
ol.source.ImageTileSource.prototype.expireCache = function(usedTiles) {
this.tileCache_.expireCache(usedTiles);
};
/**
* @inheritDoc
*/
ol.source.ImageTileSource.prototype.getTile = function(tileCoord) {
var key = tileCoord.toString();
if (goog.object.containsKey(this.tileCache_, key)) {
return this.tileCache_[key];
if (this.tileCache_.containsKey(key)) {
return /** @type {ol.Tile} */ (this.tileCache_.get(key));
} else {
var tileUrl = this.getTileCoordUrl(tileCoord);
var tile;
if (goog.isDef(tileUrl)) {
tile = new ol.ImageTile(tileCoord, tileUrl, this.crossOrigin_);
this.tileCache_.set(key, tile);
} else {
tile = null;
}
this.tileCache_[key] = tile;
return tile;
}
};
+1 -1
View File
@@ -10,7 +10,7 @@ goog.require('ol.TileUrlFunction');
/**
* @typedef {{attribtions: (Array.<ol.Attribution>|undefined),
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
* extent: (ol.Extent|undefined),
* projection: (ol.Projection|undefined)}}
*/
+1
View File
@@ -3,6 +3,7 @@
goog.provide('ol.source.TiledWMS');
goog.require('goog.array');
goog.require('goog.asserts');
goog.require('goog.object');
goog.require('goog.uri.utils');
+13
View File
@@ -1,6 +1,7 @@
goog.provide('ol.source.TileSource');
goog.provide('ol.source.TileSourceOptions');
goog.require('goog.functions');
goog.require('ol.Attribution');
goog.require('ol.Extent');
goog.require('ol.Projection');
@@ -46,6 +47,18 @@ ol.source.TileSource = function(tileSourceOptions) {
goog.inherits(ol.source.TileSource, ol.source.Source);
/**
* @return {boolean} Can expire cache.
*/
ol.source.TileSource.prototype.canExpireCache = goog.functions.FALSE;
/**
* @param {Object.<string, ol.TileRange>} usedTiles Used tiles.
*/
ol.source.TileSource.prototype.expireCache = goog.abstractMethod;
/**
* @inheritDoc
*/