Make tile transitions configurable
This commit is contained in:
@@ -38,7 +38,8 @@ ol.source.BingMaps = function(options) {
|
||||
state: ol.source.State.LOADING,
|
||||
tileLoadFunction: options.tileLoadFunction,
|
||||
tilePixelRatio: this.hidpi_ ? 2 : 1,
|
||||
wrapX: options.wrapX !== undefined ? options.wrapX : true
|
||||
wrapX: options.wrapX !== undefined ? options.wrapX : true,
|
||||
transition: options.transition
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
@@ -71,6 +71,12 @@ ol.source.Tile = function(options) {
|
||||
*/
|
||||
this.key_ = '';
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {olx.TileOptions}
|
||||
*/
|
||||
this.tileOptions = {transition: options.transition};
|
||||
|
||||
};
|
||||
ol.inherits(ol.source.Tile, ol.source.Source);
|
||||
|
||||
|
||||
@@ -39,7 +39,8 @@ ol.source.TileArcGISRest = function(opt_options) {
|
||||
tileLoadFunction: options.tileLoadFunction,
|
||||
url: options.url,
|
||||
urls: options.urls,
|
||||
wrapX: options.wrapX !== undefined ? options.wrapX : true
|
||||
wrapX: options.wrapX !== undefined ? options.wrapX : true,
|
||||
transition: options.transition
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
@@ -39,7 +39,8 @@ ol.source.TileImage = function(options) {
|
||||
tileUrlFunction: options.tileUrlFunction,
|
||||
url: options.url,
|
||||
urls: options.urls,
|
||||
wrapX: options.wrapX
|
||||
wrapX: options.wrapX,
|
||||
transition: options.transition
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -52,7 +53,7 @@ ol.source.TileImage = function(options) {
|
||||
/**
|
||||
* @protected
|
||||
* @type {function(new: ol.ImageTile, ol.TileCoord, ol.TileState, string,
|
||||
* ?string, ol.TileLoadFunctionType)}
|
||||
* ?string, ol.TileLoadFunctionType, olx.TileOptions=)}
|
||||
*/
|
||||
this.tileClass = options.tileClass !== undefined ?
|
||||
options.tileClass : ol.ImageTile;
|
||||
@@ -222,7 +223,8 @@ ol.source.TileImage.prototype.createTile_ = function(z, x, y, pixelRatio, projec
|
||||
tileUrl !== undefined ? ol.TileState.IDLE : ol.TileState.EMPTY,
|
||||
tileUrl !== undefined ? tileUrl : '',
|
||||
this.crossOrigin,
|
||||
this.tileLoadFunction);
|
||||
this.tileLoadFunction,
|
||||
this.tileOptions);
|
||||
tile.key = key;
|
||||
ol.events.listen(tile, ol.events.EventType.CHANGE,
|
||||
this.handleTileChange, this);
|
||||
|
||||
@@ -43,7 +43,8 @@ ol.source.TileJSON = function(options) {
|
||||
reprojectionErrorThreshold: options.reprojectionErrorThreshold,
|
||||
state: ol.source.State.LOADING,
|
||||
tileLoadFunction: options.tileLoadFunction,
|
||||
wrapX: options.wrapX !== undefined ? options.wrapX : true
|
||||
wrapX: options.wrapX !== undefined ? options.wrapX : true,
|
||||
transition: options.transition
|
||||
});
|
||||
|
||||
if (options.url) {
|
||||
|
||||
@@ -47,7 +47,8 @@ ol.source.TileWMS = function(opt_options) {
|
||||
tileLoadFunction: options.tileLoadFunction,
|
||||
url: options.url,
|
||||
urls: options.urls,
|
||||
wrapX: options.wrapX !== undefined ? options.wrapX : true
|
||||
wrapX: options.wrapX !== undefined ? options.wrapX : true,
|
||||
transition: options.transition
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
@@ -29,7 +29,8 @@ ol.source.UrlTile = function(options) {
|
||||
state: options.state,
|
||||
tileGrid: options.tileGrid,
|
||||
tilePixelRatio: options.tilePixelRatio,
|
||||
wrapX: options.wrapX
|
||||
wrapX: options.wrapX,
|
||||
transition: options.transition
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
@@ -51,7 +51,8 @@ ol.source.VectorTile = function(options) {
|
||||
tileUrlFunction: options.tileUrlFunction,
|
||||
url: options.url,
|
||||
urls: options.urls,
|
||||
wrapX: options.wrapX === undefined ? true : options.wrapX
|
||||
wrapX: options.wrapX === undefined ? true : options.wrapX,
|
||||
transition: options.transition
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -125,7 +126,8 @@ ol.source.VectorTile.prototype.getTile = function(z, x, y, pixelRatio, projectio
|
||||
this.format_, this.tileLoadFunction, urlTileCoord, this.tileUrlFunction,
|
||||
this.tileGrid, this.getTileGridForProjection(projection),
|
||||
this.sourceTiles_, pixelRatio, projection, this.tileClass,
|
||||
this.handleTileChange.bind(this));
|
||||
this.handleTileChange.bind(this),
|
||||
this.tileOptions);
|
||||
|
||||
this.tileCache.set(tileCoordKey, tile);
|
||||
return tile;
|
||||
|
||||
@@ -166,7 +166,8 @@ ol.source.WMTS = function(options) {
|
||||
tilePixelRatio: options.tilePixelRatio,
|
||||
tileUrlFunction: tileUrlFunction,
|
||||
urls: urls,
|
||||
wrapX: options.wrapX !== undefined ? options.wrapX : false
|
||||
wrapX: options.wrapX !== undefined ? options.wrapX : false,
|
||||
transition: options.transition
|
||||
});
|
||||
|
||||
this.setKey(this.getKeyForDimensions_());
|
||||
|
||||
@@ -54,7 +54,8 @@ ol.source.XYZ = function(opt_options) {
|
||||
tileUrlFunction: options.tileUrlFunction,
|
||||
url: options.url,
|
||||
urls: options.urls,
|
||||
wrapX: options.wrapX !== undefined ? options.wrapX : true
|
||||
wrapX: options.wrapX !== undefined ? options.wrapX : true,
|
||||
transition: options.transition
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
@@ -139,7 +139,8 @@ ol.source.Zoomify = function(opt_options) {
|
||||
reprojectionErrorThreshold: options.reprojectionErrorThreshold,
|
||||
tileClass: ol.source.Zoomify.Tile_,
|
||||
tileGrid: tileGrid,
|
||||
tileUrlFunction: tileUrlFunction
|
||||
tileUrlFunction: tileUrlFunction,
|
||||
transition: options.transition
|
||||
});
|
||||
|
||||
};
|
||||
@@ -154,12 +155,13 @@ ol.inherits(ol.source.Zoomify, ol.source.TileImage);
|
||||
* @param {string} src Image source URI.
|
||||
* @param {?string} crossOrigin Cross origin.
|
||||
* @param {ol.TileLoadFunctionType} tileLoadFunction Tile load function.
|
||||
* @param {olx.TileOptions=} opt_options Tile options.
|
||||
* @private
|
||||
*/
|
||||
ol.source.Zoomify.Tile_ = function(
|
||||
tileCoord, state, src, crossOrigin, tileLoadFunction) {
|
||||
tileCoord, state, src, crossOrigin, tileLoadFunction, opt_options) {
|
||||
|
||||
ol.ImageTile.call(this, tileCoord, state, src, crossOrigin, tileLoadFunction);
|
||||
ol.ImageTile.call(this, tileCoord, state, src, crossOrigin, tileLoadFunction, opt_options);
|
||||
|
||||
/**
|
||||
* @private
|
||||
|
||||
Reference in New Issue
Block a user