Rename _ol_source_UrlTile_ to UrlTile
This commit is contained in:
@@ -10,7 +10,7 @@ import _ol_events_ from '../events.js';
|
||||
import EventType from '../events/EventType.js';
|
||||
import {equivalent, get as getProjection} from '../proj.js';
|
||||
import _ol_reproj_Tile_ from '../reproj/Tile.js';
|
||||
import _ol_source_UrlTile_ from '../source/UrlTile.js';
|
||||
import UrlTile from '../source/UrlTile.js';
|
||||
import _ol_tilecoord_ from '../tilecoord.js';
|
||||
import _ol_tilegrid_ from '../tilegrid.js';
|
||||
|
||||
@@ -26,7 +26,7 @@ import _ol_tilegrid_ from '../tilegrid.js';
|
||||
*/
|
||||
var TileImage = function(options) {
|
||||
|
||||
_ol_source_UrlTile_.call(this, {
|
||||
UrlTile.call(this, {
|
||||
attributions: options.attributions,
|
||||
cacheSize: options.cacheSize,
|
||||
extent: options.extent,
|
||||
@@ -84,7 +84,7 @@ var TileImage = function(options) {
|
||||
this.renderReprojectionEdges_ = false;
|
||||
};
|
||||
|
||||
inherits(TileImage, _ol_source_UrlTile_);
|
||||
inherits(TileImage, UrlTile);
|
||||
|
||||
|
||||
/**
|
||||
@@ -92,7 +92,7 @@ inherits(TileImage, _ol_source_UrlTile_);
|
||||
*/
|
||||
TileImage.prototype.canExpireCache = function() {
|
||||
if (!ENABLE_RASTER_REPROJECTION) {
|
||||
return _ol_source_UrlTile_.prototype.canExpireCache.call(this);
|
||||
return UrlTile.prototype.canExpireCache.call(this);
|
||||
}
|
||||
if (this.tileCache.canExpireCache()) {
|
||||
return true;
|
||||
@@ -112,7 +112,7 @@ TileImage.prototype.canExpireCache = function() {
|
||||
*/
|
||||
TileImage.prototype.expireCache = function(projection, usedTiles) {
|
||||
if (!ENABLE_RASTER_REPROJECTION) {
|
||||
_ol_source_UrlTile_.prototype.expireCache.call(this, projection, usedTiles);
|
||||
UrlTile.prototype.expireCache.call(this, projection, usedTiles);
|
||||
return;
|
||||
}
|
||||
var usedTileCache = this.getTileCacheForProjection(projection);
|
||||
@@ -155,7 +155,7 @@ TileImage.prototype.getOpaque = function(projection) {
|
||||
this.getProjection() && projection && !equivalent(this.getProjection(), projection)) {
|
||||
return false;
|
||||
} else {
|
||||
return _ol_source_UrlTile_.prototype.getOpaque.call(this, projection);
|
||||
return UrlTile.prototype.getOpaque.call(this, projection);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -165,7 +165,7 @@ TileImage.prototype.getOpaque = function(projection) {
|
||||
*/
|
||||
TileImage.prototype.getTileGridForProjection = function(projection) {
|
||||
if (!ENABLE_RASTER_REPROJECTION) {
|
||||
return _ol_source_UrlTile_.prototype.getTileGridForProjection.call(this, projection);
|
||||
return UrlTile.prototype.getTileGridForProjection.call(this, projection);
|
||||
}
|
||||
var thisProj = this.getProjection();
|
||||
if (this.tileGrid && (!thisProj || equivalent(thisProj, projection))) {
|
||||
@@ -186,7 +186,7 @@ TileImage.prototype.getTileGridForProjection = function(projection) {
|
||||
*/
|
||||
TileImage.prototype.getTileCacheForProjection = function(projection) {
|
||||
if (!ENABLE_RASTER_REPROJECTION) {
|
||||
return _ol_source_UrlTile_.prototype.getTileCacheForProjection.call(this, projection);
|
||||
return UrlTile.prototype.getTileCacheForProjection.call(this, projection);
|
||||
}
|
||||
var thisProj = this.getProjection(); if (!thisProj || equivalent(thisProj, projection)) {
|
||||
return this.tileCache;
|
||||
|
||||
@@ -18,7 +18,7 @@ import _ol_tilecoord_ from '../tilecoord.js';
|
||||
* @extends {ol.source.Tile}
|
||||
* @param {ol.SourceUrlTileOptions} options Image tile options.
|
||||
*/
|
||||
var _ol_source_UrlTile_ = function(options) {
|
||||
var UrlTile = function(options) {
|
||||
|
||||
TileSource.call(this, {
|
||||
attributions: options.attributions,
|
||||
@@ -69,21 +69,21 @@ var _ol_source_UrlTile_ = function(options) {
|
||||
|
||||
};
|
||||
|
||||
inherits(_ol_source_UrlTile_, TileSource);
|
||||
inherits(UrlTile, TileSource);
|
||||
|
||||
|
||||
/**
|
||||
* @type {ol.TileUrlFunctionType|undefined}
|
||||
* @protected
|
||||
*/
|
||||
_ol_source_UrlTile_.prototype.fixedTileUrlFunction;
|
||||
UrlTile.prototype.fixedTileUrlFunction;
|
||||
|
||||
/**
|
||||
* Return the tile load function of the source.
|
||||
* @return {ol.TileLoadFunctionType} TileLoadFunction
|
||||
* @api
|
||||
*/
|
||||
_ol_source_UrlTile_.prototype.getTileLoadFunction = function() {
|
||||
UrlTile.prototype.getTileLoadFunction = function() {
|
||||
return this.tileLoadFunction;
|
||||
};
|
||||
|
||||
@@ -93,7 +93,7 @@ _ol_source_UrlTile_.prototype.getTileLoadFunction = function() {
|
||||
* @return {ol.TileUrlFunctionType} TileUrlFunction
|
||||
* @api
|
||||
*/
|
||||
_ol_source_UrlTile_.prototype.getTileUrlFunction = function() {
|
||||
UrlTile.prototype.getTileUrlFunction = function() {
|
||||
return this.tileUrlFunction;
|
||||
};
|
||||
|
||||
@@ -105,7 +105,7 @@ _ol_source_UrlTile_.prototype.getTileUrlFunction = function() {
|
||||
* @return {!Array.<string>|null} URLs.
|
||||
* @api
|
||||
*/
|
||||
_ol_source_UrlTile_.prototype.getUrls = function() {
|
||||
UrlTile.prototype.getUrls = function() {
|
||||
return this.urls;
|
||||
};
|
||||
|
||||
@@ -115,7 +115,7 @@ _ol_source_UrlTile_.prototype.getUrls = function() {
|
||||
* @param {ol.events.Event} event Event.
|
||||
* @protected
|
||||
*/
|
||||
_ol_source_UrlTile_.prototype.handleTileChange = function(event) {
|
||||
UrlTile.prototype.handleTileChange = function(event) {
|
||||
var tile = /** @type {ol.Tile} */ (event.target);
|
||||
var uid = getUid(tile);
|
||||
var tileState = tile.getState();
|
||||
@@ -140,7 +140,7 @@ _ol_source_UrlTile_.prototype.handleTileChange = function(event) {
|
||||
* @param {ol.TileLoadFunctionType} tileLoadFunction Tile load function.
|
||||
* @api
|
||||
*/
|
||||
_ol_source_UrlTile_.prototype.setTileLoadFunction = function(tileLoadFunction) {
|
||||
UrlTile.prototype.setTileLoadFunction = function(tileLoadFunction) {
|
||||
this.tileCache.clear();
|
||||
this.tileLoadFunction = tileLoadFunction;
|
||||
this.changed();
|
||||
@@ -153,7 +153,7 @@ _ol_source_UrlTile_.prototype.setTileLoadFunction = function(tileLoadFunction) {
|
||||
* @param {string=} opt_key Optional new tile key for the source.
|
||||
* @api
|
||||
*/
|
||||
_ol_source_UrlTile_.prototype.setTileUrlFunction = function(tileUrlFunction, opt_key) {
|
||||
UrlTile.prototype.setTileUrlFunction = function(tileUrlFunction, opt_key) {
|
||||
this.tileUrlFunction = tileUrlFunction;
|
||||
this.tileCache.pruneExceptNewestZ();
|
||||
if (typeof opt_key !== 'undefined') {
|
||||
@@ -169,7 +169,7 @@ _ol_source_UrlTile_.prototype.setTileUrlFunction = function(tileUrlFunction, opt
|
||||
* @param {string} url URL.
|
||||
* @api
|
||||
*/
|
||||
_ol_source_UrlTile_.prototype.setUrl = function(url) {
|
||||
UrlTile.prototype.setUrl = function(url) {
|
||||
var urls = this.urls = expandUrl(url);
|
||||
this.setTileUrlFunction(this.fixedTileUrlFunction ?
|
||||
this.fixedTileUrlFunction.bind(this) :
|
||||
@@ -182,7 +182,7 @@ _ol_source_UrlTile_.prototype.setUrl = function(url) {
|
||||
* @param {Array.<string>} urls URLs.
|
||||
* @api
|
||||
*/
|
||||
_ol_source_UrlTile_.prototype.setUrls = function(urls) {
|
||||
UrlTile.prototype.setUrls = function(urls) {
|
||||
this.urls = urls;
|
||||
var key = urls.join('\n');
|
||||
this.setTileUrlFunction(this.fixedTileUrlFunction ?
|
||||
@@ -194,10 +194,10 @@ _ol_source_UrlTile_.prototype.setUrls = function(urls) {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_source_UrlTile_.prototype.useTile = function(z, x, y) {
|
||||
UrlTile.prototype.useTile = function(z, x, y) {
|
||||
var tileCoordKey = _ol_tilecoord_.getKeyZXY(z, x, y);
|
||||
if (this.tileCache.containsKey(tileCoordKey)) {
|
||||
this.tileCache.get(tileCoordKey);
|
||||
}
|
||||
};
|
||||
export default _ol_source_UrlTile_;
|
||||
export default UrlTile;
|
||||
|
||||
@@ -6,7 +6,7 @@ import TileState from '../TileState.js';
|
||||
import VectorImageTile, {defaultLoadFunction} from '../VectorImageTile.js';
|
||||
import VectorTile from '../VectorTile.js';
|
||||
import _ol_size_ from '../size.js';
|
||||
import _ol_source_UrlTile_ from '../source/UrlTile.js';
|
||||
import UrlTile from '../source/UrlTile.js';
|
||||
import _ol_tilecoord_ from '../tilecoord.js';
|
||||
import _ol_tilegrid_ from '../tilegrid.js';
|
||||
|
||||
@@ -38,7 +38,7 @@ var _ol_source_VectorTile_ = function(options) {
|
||||
tileSize: options.tileSize || 512
|
||||
});
|
||||
|
||||
_ol_source_UrlTile_.call(this, {
|
||||
UrlTile.call(this, {
|
||||
attributions: options.attributions,
|
||||
cacheSize: options.cacheSize !== undefined ? options.cacheSize : 128,
|
||||
extent: extent,
|
||||
@@ -87,7 +87,7 @@ var _ol_source_VectorTile_ = function(options) {
|
||||
|
||||
};
|
||||
|
||||
inherits(_ol_source_VectorTile_, _ol_source_UrlTile_);
|
||||
inherits(_ol_source_VectorTile_, UrlTile);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user