Rename _ol_TileState_ to TileState
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
import {inherits, nullFunction} from '../index.js';
|
||||
import TileCache from '../TileCache.js';
|
||||
import _ol_TileState_ from '../TileState.js';
|
||||
import TileState from '../TileState.js';
|
||||
import Event from '../events/Event.js';
|
||||
import {equivalent} from '../proj.js';
|
||||
import _ol_size_ from '../size.js';
|
||||
@@ -124,7 +124,7 @@ _ol_source_Tile_.prototype.forEachLoadedTile = function(projection, z, tileRange
|
||||
loaded = false;
|
||||
if (tileCache.containsKey(tileCoordKey)) {
|
||||
tile = /** @type {!ol.Tile} */ (tileCache.get(tileCoordKey));
|
||||
loaded = tile.getState() === _ol_TileState_.LOADED;
|
||||
loaded = tile.getState() === TileState.LOADED;
|
||||
if (loaded) {
|
||||
loaded = (callback(tile) !== false);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_Tile_ from '../Tile.js';
|
||||
import _ol_TileState_ from '../TileState.js';
|
||||
import TileState from '../TileState.js';
|
||||
import {createCanvasContext2D} from '../dom.js';
|
||||
import _ol_size_ from '../size.js';
|
||||
import _ol_source_Tile_ from '../source/Tile.js';
|
||||
@@ -66,7 +66,7 @@ _ol_source_TileDebug_.prototype.getTile = function(z, x, y) {
|
||||
*/
|
||||
_ol_source_TileDebug_.Tile_ = function(tileCoord, tileSize, text) {
|
||||
|
||||
_ol_Tile_.call(this, tileCoord, _ol_TileState_.LOADED);
|
||||
_ol_Tile_.call(this, tileCoord, TileState.LOADED);
|
||||
|
||||
/**
|
||||
* @private
|
||||
|
||||
@@ -5,7 +5,7 @@ import {ENABLE_RASTER_REPROJECTION} from '../reproj/common.js';
|
||||
import {getUid, inherits} from '../index.js';
|
||||
import _ol_ImageTile_ from '../ImageTile.js';
|
||||
import TileCache from '../TileCache.js';
|
||||
import _ol_TileState_ from '../TileState.js';
|
||||
import TileState from '../TileState.js';
|
||||
import _ol_events_ from '../events.js';
|
||||
import EventType from '../events/EventType.js';
|
||||
import {equivalent, get as getProjection} from '../proj.js';
|
||||
@@ -218,7 +218,7 @@ _ol_source_TileImage_.prototype.createTile_ = function(z, x, y, pixelRatio, proj
|
||||
this.tileUrlFunction(urlTileCoord, pixelRatio, projection) : undefined;
|
||||
var tile = new this.tileClass(
|
||||
tileCoord,
|
||||
tileUrl !== undefined ? _ol_TileState_.IDLE : _ol_TileState_.EMPTY,
|
||||
tileUrl !== undefined ? TileState.IDLE : TileState.EMPTY,
|
||||
tileUrl !== undefined ? tileUrl : '',
|
||||
this.crossOrigin,
|
||||
this.tileLoadFunction,
|
||||
@@ -304,7 +304,7 @@ _ol_source_TileImage_.prototype.getTileInternal = function(z, x, y, pixelRatio,
|
||||
tile = this.createTile_(z, x, y, pixelRatio, projection, key);
|
||||
|
||||
//make the new tile the head of the list,
|
||||
if (interimTile.getState() == _ol_TileState_.IDLE) {
|
||||
if (interimTile.getState() == TileState.IDLE) {
|
||||
//the old tile hasn't begun loading yet, and is now outdated, so we can simply discard it
|
||||
tile.interimTile = interimTile.interimTile;
|
||||
} else {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_Tile_ from '../Tile.js';
|
||||
import _ol_TileState_ from '../TileState.js';
|
||||
import TileState from '../TileState.js';
|
||||
import {createFromTemplates, nullTileUrlFunction} from '../tileurlfunction.js';
|
||||
import {assert} from '../asserts.js';
|
||||
import _ol_events_ from '../events.js';
|
||||
@@ -224,7 +224,7 @@ _ol_source_TileUTFGrid_.prototype.getTile = function(z, x, y, pixelRatio, projec
|
||||
var tileUrl = this.tileUrlFunction_(urlTileCoord, pixelRatio, projection);
|
||||
var tile = new _ol_source_TileUTFGrid_.Tile_(
|
||||
tileCoord,
|
||||
tileUrl !== undefined ? _ol_TileState_.IDLE : _ol_TileState_.EMPTY,
|
||||
tileUrl !== undefined ? TileState.IDLE : TileState.EMPTY,
|
||||
tileUrl !== undefined ? tileUrl : '',
|
||||
this.tileGrid.getTileCoordExtent(tileCoord),
|
||||
this.preemptive_,
|
||||
@@ -370,7 +370,7 @@ _ol_source_TileUTFGrid_.Tile_.prototype.getData = function(coordinate) {
|
||||
* @template T
|
||||
*/
|
||||
_ol_source_TileUTFGrid_.Tile_.prototype.forDataAtCoordinate = function(coordinate, callback, opt_this, opt_request) {
|
||||
if (this.state == _ol_TileState_.IDLE && opt_request === true) {
|
||||
if (this.state == TileState.IDLE && opt_request === true) {
|
||||
_ol_events_.listenOnce(this, EventType.CHANGE, function(e) {
|
||||
callback.call(opt_this, this.getData(coordinate));
|
||||
}, this);
|
||||
@@ -399,7 +399,7 @@ _ol_source_TileUTFGrid_.Tile_.prototype.getKey = function() {
|
||||
* @private
|
||||
*/
|
||||
_ol_source_TileUTFGrid_.Tile_.prototype.handleError_ = function() {
|
||||
this.state = _ol_TileState_.ERROR;
|
||||
this.state = TileState.ERROR;
|
||||
this.changed();
|
||||
};
|
||||
|
||||
@@ -413,7 +413,7 @@ _ol_source_TileUTFGrid_.Tile_.prototype.handleLoad_ = function(json) {
|
||||
this.keys_ = json.keys;
|
||||
this.data_ = json.data;
|
||||
|
||||
this.state = _ol_TileState_.EMPTY;
|
||||
this.state = TileState.EMPTY;
|
||||
this.changed();
|
||||
};
|
||||
|
||||
@@ -422,8 +422,8 @@ _ol_source_TileUTFGrid_.Tile_.prototype.handleLoad_ = function(json) {
|
||||
* @private
|
||||
*/
|
||||
_ol_source_TileUTFGrid_.Tile_.prototype.loadInternal_ = function() {
|
||||
if (this.state == _ol_TileState_.IDLE) {
|
||||
this.state = _ol_TileState_.LOADING;
|
||||
if (this.state == TileState.IDLE) {
|
||||
this.state = TileState.LOADING;
|
||||
if (this.jsonp_) {
|
||||
_ol_net_.jsonp(this.src_, this.handleLoad_.bind(this),
|
||||
this.handleError_.bind(this));
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @module ol/source/UrlTile
|
||||
*/
|
||||
import {getUid, inherits} from '../index.js';
|
||||
import _ol_TileState_ from '../TileState.js';
|
||||
import TileState from '../TileState.js';
|
||||
import {expandUrl, createFromTemplates, nullTileUrlFunction} from '../tileurlfunction.js';
|
||||
import _ol_source_Tile_ from '../source/Tile.js';
|
||||
import TileEventType from '../source/TileEventType.js';
|
||||
@@ -120,13 +120,13 @@ _ol_source_UrlTile_.prototype.handleTileChange = function(event) {
|
||||
var uid = getUid(tile);
|
||||
var tileState = tile.getState();
|
||||
var type;
|
||||
if (tileState == _ol_TileState_.LOADING) {
|
||||
if (tileState == TileState.LOADING) {
|
||||
this.tileLoadingKeys_[uid] = true;
|
||||
type = TileEventType.TILELOADSTART;
|
||||
} else if (uid in this.tileLoadingKeys_) {
|
||||
delete this.tileLoadingKeys_[uid];
|
||||
type = tileState == _ol_TileState_.ERROR ? TileEventType.TILELOADERROR :
|
||||
(tileState == _ol_TileState_.LOADED || tileState == _ol_TileState_.ABORT) ?
|
||||
type = tileState == TileState.ERROR ? TileEventType.TILELOADERROR :
|
||||
(tileState == TileState.LOADED || tileState == TileState.ABORT) ?
|
||||
TileEventType.TILELOADEND : undefined;
|
||||
}
|
||||
if (type != undefined) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @module ol/source/VectorTile
|
||||
*/
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_TileState_ from '../TileState.js';
|
||||
import TileState from '../TileState.js';
|
||||
import _ol_VectorImageTile_ from '../VectorImageTile.js';
|
||||
import _ol_VectorTile_ from '../VectorTile.js';
|
||||
import _ol_size_ from '../size.js';
|
||||
@@ -120,7 +120,7 @@ _ol_source_VectorTile_.prototype.getTile = function(z, x, y, pixelRatio, project
|
||||
tileCoord, projection);
|
||||
var tile = new _ol_VectorImageTile_(
|
||||
tileCoord,
|
||||
urlTileCoord !== null ? _ol_TileState_.IDLE : _ol_TileState_.EMPTY,
|
||||
urlTileCoord !== null ? TileState.IDLE : TileState.EMPTY,
|
||||
this.getRevision(),
|
||||
this.format_, this.tileLoadFunction, urlTileCoord, this.tileUrlFunction,
|
||||
this.tileGrid, this.getTileGridForProjection(projection),
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import {DEFAULT_TILE_SIZE} from '../tilegrid/common.js';
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_ImageTile_ from '../ImageTile.js';
|
||||
import _ol_TileState_ from '../TileState.js';
|
||||
import TileState from '../TileState.js';
|
||||
import {expandUrl, createFromTileUrlFunctions} from '../tileurlfunction.js';
|
||||
import {assert} from '../asserts.js';
|
||||
import {createCanvasContext2D} from '../dom.js';
|
||||
@@ -193,7 +193,7 @@ _ol_source_Zoomify_.Tile_.prototype.getImage = function() {
|
||||
return this.zoomifyImage_;
|
||||
}
|
||||
var image = _ol_ImageTile_.prototype.getImage.call(this);
|
||||
if (this.state == _ol_TileState_.LOADED) {
|
||||
if (this.state == TileState.LOADED) {
|
||||
var tileSize = this.tileSize_;
|
||||
if (image.width == tileSize[0] && image.height == tileSize[1]) {
|
||||
this.zoomifyImage_ = image;
|
||||
|
||||
Reference in New Issue
Block a user