Merge pull request #2529 from petrsloup/source-state-fix
Fix for invalid initial state of certain sources
This commit is contained in:
@@ -2963,6 +2963,7 @@ olx.source.GPXOptions.prototype.urls;
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
* opaque: (boolean|undefined),
|
||||
* projection: ol.proj.ProjectionLike,
|
||||
* state: (ol.source.State|string|undefined),
|
||||
* tileClass: (function(new: ol.ImageTile, ol.TileCoord,
|
||||
* ol.TileState, string, ?string,
|
||||
* ol.TileLoadFunctionType)|undefined),
|
||||
@@ -3010,6 +3011,13 @@ olx.source.TileImageOptions.prototype.opaque;
|
||||
olx.source.TileImageOptions.prototype.projection;
|
||||
|
||||
|
||||
/**
|
||||
* Source state.
|
||||
* @type {ol.source.State|string|undefined}
|
||||
*/
|
||||
olx.source.TileImageOptions.prototype.state;
|
||||
|
||||
|
||||
/**
|
||||
* tile class
|
||||
* @type {function(new: ol.ImageTile, ol.TileCoord,
|
||||
|
||||
@@ -23,7 +23,8 @@ ol.source.ImageCanvas = function(options) {
|
||||
logo: options.logo,
|
||||
projection: options.projection,
|
||||
resolutions: options.resolutions,
|
||||
state: options.state
|
||||
state: goog.isDef(options.state) ?
|
||||
/** @type {ol.source.State} */ (options.state) : undefined
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,7 +14,7 @@ goog.require('ol.source.Source');
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
* projection: ol.proj.ProjectionLike,
|
||||
* resolutions: (Array.<number>|undefined),
|
||||
* state: (ol.source.State|string|undefined)}}
|
||||
* state: (ol.source.State|undefined)}}
|
||||
*/
|
||||
ol.source.ImageOptions;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ ol.source.State = {
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
* projection: ol.proj.ProjectionLike,
|
||||
* state: (ol.source.State|string|undefined)}}
|
||||
* state: (ol.source.State|undefined)}}
|
||||
*/
|
||||
ol.source.SourceOptions;
|
||||
|
||||
@@ -69,7 +69,7 @@ ol.source.Source = function(options) {
|
||||
* @type {ol.source.State}
|
||||
*/
|
||||
this.state_ = goog.isDef(options.state) ?
|
||||
/** @type {ol.source.State} */ (options.state) : ol.source.State.READY;
|
||||
options.state : ol.source.State.READY;
|
||||
|
||||
};
|
||||
goog.inherits(ol.source.Source, ol.Observable);
|
||||
|
||||
@@ -29,6 +29,8 @@ ol.source.TileImage = function(options) {
|
||||
logo: options.logo,
|
||||
opaque: options.opaque,
|
||||
projection: options.projection,
|
||||
state: goog.isDef(options.state) ?
|
||||
/** @type {ol.source.State} */ (options.state) : undefined,
|
||||
tileGrid: options.tileGrid,
|
||||
tilePixelRatio: options.tilePixelRatio
|
||||
});
|
||||
|
||||
@@ -17,6 +17,7 @@ goog.require('ol.tilegrid.TileGrid');
|
||||
* opaque: (boolean|undefined),
|
||||
* tilePixelRatio: (number|undefined),
|
||||
* projection: ol.proj.ProjectionLike,
|
||||
* state: (ol.source.State|undefined),
|
||||
* tileGrid: (ol.tilegrid.TileGrid|undefined)}}
|
||||
*/
|
||||
ol.source.TileOptions;
|
||||
@@ -39,7 +40,8 @@ ol.source.Tile = function(options) {
|
||||
attributions: options.attributions,
|
||||
extent: options.extent,
|
||||
logo: options.logo,
|
||||
projection: options.projection
|
||||
projection: options.projection,
|
||||
state: options.state
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
@@ -56,7 +56,8 @@ ol.source.Vector = function(opt_options) {
|
||||
attributions: options.attributions,
|
||||
logo: options.logo,
|
||||
projection: options.projection,
|
||||
state: options.state
|
||||
state: goog.isDef(options.state) ?
|
||||
/** @type {ol.source.State} */ (options.state) : undefined
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user