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

This commit is contained in:
Tim Schaub
2013-03-03 09:46:11 +01:00
29 changed files with 715 additions and 295 deletions

View File

@@ -109,3 +109,14 @@ ol.source.ImageTileSource.prototype.getTile = function(tileCoord) {
ol.source.ImageTileSource.prototype.getTileCoordUrl = function(tileCoord) {
return this.tileUrlFunction(tileCoord);
};
/**
* @inheritDoc
*/
ol.source.ImageTileSource.prototype.useTile = function(tileCoord) {
var key = tileCoord.toString();
if (this.tileCache_.containsKey(key)) {
this.tileCache_.get(key);
}
};

View File

@@ -1,5 +1,6 @@
goog.provide('ol.source.SingleImageWMS');
goog.require('goog.uri.utils');
goog.require('ol.Extent');
goog.require('ol.Image');
goog.require('ol.ImageUrlFunction');

View File

@@ -69,7 +69,7 @@ ol.source.TiledWMS = function(tiledWMSOptions) {
tileUrlFunction = ol.TileUrlFunction.nullTileUrlFunction;
}
function tileCoordTransform(tileCoord) {
var tileCoordTransform = function(tileCoord) {
if (tileGrid.getResolutions().length <= tileCoord.z) {
return null;
}
@@ -90,7 +90,7 @@ ol.source.TiledWMS = function(tiledWMSOptions) {
return null;
}
return new ol.TileCoord(tileCoord.z, x, tileCoord.y);
}
};
goog.base(this, {
attributions: tiledWMSOptions.attributions,

View File

@@ -119,3 +119,29 @@ ol.source.TileSource.prototype.getTile = goog.abstractMethod;
ol.source.TileSource.prototype.getTileGrid = function() {
return this.tileGrid;
};
/**
* @param {number} z Z.
* @param {ol.Extent} extent Extent.
*/
ol.source.TileSource.prototype.useLowResolutionTiles = function(z, extent) {
var tileGrid = this.getTileGrid();
var tileRange, x, y, zKey;
// FIXME this should loop up to tileGrid's minZ when implemented
for (; z >= 0; --z) {
tileRange = tileGrid.getTileRangeForExtentAndZ(extent, z);
for (x = tileRange.minX; x <= tileRange.maxX; ++x) {
for (y = tileRange.minY; y <= tileRange.maxY; ++y) {
this.useTile(z + '/' + x + '/' + y);
}
}
}
};
/**
* Marks a tile coord as being used, without triggering a load.
* @param {string} tileCoordKey Tile coordinate key.
*/
ol.source.TileSource.prototype.useTile = goog.nullFunction;