Rename _ol_source_State_ to SourceState
This commit is contained in:
@@ -6,7 +6,7 @@ import {createFromTileUrlFunctions} from '../tileurlfunction.js';
|
||||
import {applyTransform, intersects} from '../extent.js';
|
||||
import _ol_net_ from '../net.js';
|
||||
import {get as getProjection, getTransformFromProjections} from '../proj.js';
|
||||
import _ol_source_State_ from '../source/State.js';
|
||||
import SourceState from '../source/State.js';
|
||||
import _ol_source_TileImage_ from '../source/TileImage.js';
|
||||
import _ol_tilecoord_ from '../tilecoord.js';
|
||||
import _ol_tilegrid_ from '../tilegrid.js';
|
||||
@@ -34,7 +34,7 @@ var _ol_source_BingMaps_ = function(options) {
|
||||
opaque: true,
|
||||
projection: getProjection('EPSG:3857'),
|
||||
reprojectionErrorThreshold: options.reprojectionErrorThreshold,
|
||||
state: _ol_source_State_.LOADING,
|
||||
state: SourceState.LOADING,
|
||||
tileLoadFunction: options.tileLoadFunction,
|
||||
tilePixelRatio: this.hidpi_ ? 2 : 1,
|
||||
wrapX: options.wrapX !== undefined ? options.wrapX : true,
|
||||
@@ -121,7 +121,7 @@ _ol_source_BingMaps_.prototype.handleImageryMetadataResponse = function(response
|
||||
response.authenticationResultCode != 'ValidCredentials' ||
|
||||
response.resourceSets.length != 1 ||
|
||||
response.resourceSets[0].resources.length != 1) {
|
||||
this.setState(_ol_source_State_.ERROR);
|
||||
this.setState(SourceState.ERROR);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -204,6 +204,6 @@ _ol_source_BingMaps_.prototype.handleImageryMetadataResponse = function(response
|
||||
});
|
||||
}
|
||||
|
||||
this.setState(_ol_source_State_.READY);
|
||||
this.setState(SourceState.READY);
|
||||
};
|
||||
export default _ol_source_BingMaps_;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_obj_ from '../obj.js';
|
||||
import _ol_source_State_ from '../source/State.js';
|
||||
import SourceState from '../source/State.js';
|
||||
import _ol_source_XYZ_ from '../source/XYZ.js';
|
||||
|
||||
/**
|
||||
@@ -48,7 +48,7 @@ var _ol_source_CartoDB_ = function(options) {
|
||||
maxZoom: options.maxZoom !== undefined ? options.maxZoom : 18,
|
||||
minZoom: options.minZoom,
|
||||
projection: options.projection,
|
||||
state: _ol_source_State_.LOADING,
|
||||
state: SourceState.LOADING,
|
||||
wrapX: options.wrapX
|
||||
});
|
||||
this.initializeMap_();
|
||||
@@ -132,14 +132,14 @@ _ol_source_CartoDB_.prototype.handleInitResponse_ = function(paramHash, event) {
|
||||
try {
|
||||
response = /** @type {CartoDBLayerInfo} */(JSON.parse(client.responseText));
|
||||
} catch (err) {
|
||||
this.setState(_ol_source_State_.ERROR);
|
||||
this.setState(SourceState.ERROR);
|
||||
return;
|
||||
}
|
||||
this.applyTemplate_(response);
|
||||
this.templateCache_[paramHash] = response;
|
||||
this.setState(_ol_source_State_.READY);
|
||||
this.setState(SourceState.READY);
|
||||
} else {
|
||||
this.setState(_ol_source_State_.ERROR);
|
||||
this.setState(SourceState.ERROR);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -149,7 +149,7 @@ _ol_source_CartoDB_.prototype.handleInitResponse_ = function(paramHash, event) {
|
||||
* @param {Event} event Event.
|
||||
*/
|
||||
_ol_source_CartoDB_.prototype.handleInitError_ = function(event) {
|
||||
this.setState(_ol_source_State_.ERROR);
|
||||
this.setState(SourceState.ERROR);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import _ol_renderer_canvas_ImageLayer_ from '../renderer/canvas/ImageLayer.js';
|
||||
import _ol_renderer_canvas_TileLayer_ from '../renderer/canvas/TileLayer.js';
|
||||
import _ol_source_Image_ from '../source/Image.js';
|
||||
import _ol_source_RasterOperationType_ from '../source/RasterOperationType.js';
|
||||
import _ol_source_State_ from '../source/State.js';
|
||||
import SourceState from '../source/State.js';
|
||||
import _ol_source_Tile_ from '../source/Tile.js';
|
||||
import _ol_transform_ from '../transform.js';
|
||||
|
||||
@@ -201,7 +201,7 @@ _ol_source_Raster_.prototype.allSourcesReady_ = function() {
|
||||
var source;
|
||||
for (var i = 0, ii = this.renderers_.length; i < ii; ++i) {
|
||||
source = this.renderers_[i].getLayer().getSource();
|
||||
if (source.getState() !== _ol_source_State_.READY) {
|
||||
if (source.getState() !== SourceState.READY) {
|
||||
ready = false;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import {inherits, nullFunction} from '../index.js';
|
||||
import _ol_Object_ from '../Object.js';
|
||||
import {get as getProjection} from '../proj.js';
|
||||
import _ol_source_State_ from '../source/State.js';
|
||||
import SourceState from '../source/State.js';
|
||||
|
||||
|
||||
/**
|
||||
@@ -42,7 +42,7 @@ var _ol_source_Source_ = function(options) {
|
||||
* @type {ol.source.State}
|
||||
*/
|
||||
this.state_ = options.state !== undefined ?
|
||||
options.state : _ol_source_State_.READY;
|
||||
options.state : SourceState.READY;
|
||||
|
||||
/**
|
||||
* @private
|
||||
|
||||
@@ -13,7 +13,7 @@ import {assert} from '../asserts.js';
|
||||
import {applyTransform, intersects} from '../extent.js';
|
||||
import _ol_net_ from '../net.js';
|
||||
import {get as getProjection, getTransformFromProjections} from '../proj.js';
|
||||
import _ol_source_State_ from '../source/State.js';
|
||||
import SourceState from '../source/State.js';
|
||||
import _ol_source_TileImage_ from '../source/TileImage.js';
|
||||
import _ol_tilegrid_ from '../tilegrid.js';
|
||||
|
||||
@@ -40,7 +40,7 @@ var _ol_source_TileJSON_ = function(options) {
|
||||
crossOrigin: options.crossOrigin,
|
||||
projection: getProjection('EPSG:3857'),
|
||||
reprojectionErrorThreshold: options.reprojectionErrorThreshold,
|
||||
state: _ol_source_State_.LOADING,
|
||||
state: SourceState.LOADING,
|
||||
tileLoadFunction: options.tileLoadFunction,
|
||||
wrapX: options.wrapX !== undefined ? options.wrapX : true,
|
||||
transition: options.transition
|
||||
@@ -148,7 +148,7 @@ _ol_source_TileJSON_.prototype.handleTileJSONResponse = function(tileJSON) {
|
||||
|
||||
}
|
||||
this.tileJSON_ = tileJSON;
|
||||
this.setState(_ol_source_State_.READY);
|
||||
this.setState(SourceState.READY);
|
||||
|
||||
};
|
||||
|
||||
@@ -157,6 +157,6 @@ _ol_source_TileJSON_.prototype.handleTileJSONResponse = function(tileJSON) {
|
||||
* @protected
|
||||
*/
|
||||
_ol_source_TileJSON_.prototype.handleTileJSONError = function() {
|
||||
this.setState(_ol_source_State_.ERROR);
|
||||
this.setState(SourceState.ERROR);
|
||||
};
|
||||
export default _ol_source_TileJSON_;
|
||||
|
||||
@@ -11,7 +11,7 @@ import EventType from '../events/EventType.js';
|
||||
import {applyTransform, intersects} from '../extent.js';
|
||||
import _ol_net_ from '../net.js';
|
||||
import {get as getProjection, getTransformFromProjections} from '../proj.js';
|
||||
import _ol_source_State_ from '../source/State.js';
|
||||
import SourceState from '../source/State.js';
|
||||
import _ol_source_Tile_ from '../source/Tile.js';
|
||||
import _ol_tilecoord_ from '../tilecoord.js';
|
||||
import _ol_tilegrid_ from '../tilegrid.js';
|
||||
@@ -28,7 +28,7 @@ import _ol_tilegrid_ from '../tilegrid.js';
|
||||
var _ol_source_TileUTFGrid_ = function(options) {
|
||||
_ol_source_Tile_.call(this, {
|
||||
projection: getProjection('EPSG:3857'),
|
||||
state: _ol_source_State_.LOADING
|
||||
state: SourceState.LOADING
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -155,7 +155,7 @@ _ol_source_TileUTFGrid_.prototype.forDataAtCoordinateAndResolution = function(
|
||||
* @protected
|
||||
*/
|
||||
_ol_source_TileUTFGrid_.prototype.handleTileJSONError = function() {
|
||||
this.setState(_ol_source_State_.ERROR);
|
||||
this.setState(SourceState.ERROR);
|
||||
};
|
||||
|
||||
|
||||
@@ -189,7 +189,7 @@ _ol_source_TileUTFGrid_.prototype.handleTileJSONResponse = function(tileJSON) {
|
||||
|
||||
var grids = tileJSON.grids;
|
||||
if (!grids) {
|
||||
this.setState(_ol_source_State_.ERROR);
|
||||
this.setState(SourceState.ERROR);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ _ol_source_TileUTFGrid_.prototype.handleTileJSONResponse = function(tileJSON) {
|
||||
});
|
||||
}
|
||||
|
||||
this.setState(_ol_source_State_.READY);
|
||||
this.setState(SourceState.READY);
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import {TRUE} from '../functions.js';
|
||||
import _ol_loadingstrategy_ from '../loadingstrategy.js';
|
||||
import _ol_obj_ from '../obj.js';
|
||||
import _ol_source_Source_ from '../source/Source.js';
|
||||
import _ol_source_State_ from '../source/State.js';
|
||||
import SourceState from '../source/State.js';
|
||||
import _ol_source_VectorEventType_ from '../source/VectorEventType.js';
|
||||
import RBush from '../structs/RBush.js';
|
||||
|
||||
@@ -40,7 +40,7 @@ var _ol_source_Vector_ = function(opt_options) {
|
||||
_ol_source_Source_.call(this, {
|
||||
attributions: options.attributions,
|
||||
projection: undefined,
|
||||
state: _ol_source_State_.READY,
|
||||
state: SourceState.READY,
|
||||
wrapX: options.wrapX !== undefined ? options.wrapX : true
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user