Allow ol.source.Source state option to be a string

This commit is contained in:
Tom Payne
2014-02-06 19:40:45 +01:00
parent e53d7e954b
commit 88c8783271
3 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -711,7 +711,7 @@
* on. * on.
* @property {Array.<number>|undefined} resolutions Resolutions. If specified, * @property {Array.<number>|undefined} resolutions Resolutions. If specified,
* new canvases will be created for these resolutions only. * new canvases will be created for these resolutions only.
* @property {ol.source.State|undefined} state Source state. * @property {ol.source.State|string|undefined} state Source state.
*/ */
/** /**
@@ -836,7 +836,7 @@
* @property {Array.<ol.Feature>|undefined} features Features. * @property {Array.<ol.Feature>|undefined} features Features.
* @property {string|undefined} logo Logo. * @property {string|undefined} logo Logo.
* @property {ol.proj.ProjectionLike} projection Projection. * @property {ol.proj.ProjectionLike} projection Projection.
* @property {ol.source.State|undefined} state State. * @property {ol.source.State|string|undefined} state State.
*/ */
/** /**
+1 -1
View File
@@ -15,7 +15,7 @@ goog.require('ol.source.Source');
* logo: (string|undefined), * logo: (string|undefined),
* projection: ol.proj.ProjectionLike, * projection: ol.proj.ProjectionLike,
* resolutions: (Array.<number>|undefined), * resolutions: (Array.<number>|undefined),
* state: (ol.source.State|undefined)}} * state: (ol.source.State|string|undefined)}}
*/ */
ol.source.ImageOptions; ol.source.ImageOptions;
+2 -2
View File
@@ -23,7 +23,7 @@ ol.source.State = {
* extent: (ol.Extent|undefined), * extent: (ol.Extent|undefined),
* logo: (string|undefined), * logo: (string|undefined),
* projection: ol.proj.ProjectionLike, * projection: ol.proj.ProjectionLike,
* state: (ol.source.State|undefined)}} * state: (ol.source.State|string|undefined)}}
* @todo stability experimental * @todo stability experimental
*/ */
ol.source.SourceOptions; ol.source.SourceOptions;
@@ -72,7 +72,7 @@ ol.source.Source = function(options) {
* @type {ol.source.State} * @type {ol.source.State}
*/ */
this.state_ = goog.isDef(options.state) ? this.state_ = goog.isDef(options.state) ?
options.state : ol.source.State.READY; /** @type {ol.source.State} */ (options.state) : ol.source.State.READY;
}; };
goog.inherits(ol.source.Source, ol.Observable); goog.inherits(ol.source.Source, ol.Observable);