Merge branch 'master' of github.com:openlayers/ol3 into vector
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user