From b99b19f8762109ce81936e96f8938b94e03e9df2 Mon Sep 17 00:00:00 2001 From: Roman Zoller Date: Thu, 22 Mar 2018 17:20:24 +0100 Subject: [PATCH] Move olx.layer.BaseOptions to ol/layer/Base --- externs/olx.js | 61 ------------------------------------------- src/ol/layer/Base.js | 18 ++++++++++++- src/ol/layer/Layer.js | 2 +- 3 files changed, 18 insertions(+), 63 deletions(-) diff --git a/externs/olx.js b/externs/olx.js index f3345b4eed..2405a467da 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -5,67 +5,6 @@ let olx; -/** - * @typedef {{opacity: (number|undefined), - * visible: (boolean|undefined), - * extent: (ol.Extent|undefined), - * zIndex: (number|undefined), - * minResolution: (number|undefined), - * maxResolution: (number|undefined)}} - */ -olx.layer.BaseOptions; - - -/** - * Opacity (0, 1). Default is `1`. - * @type {number|undefined} - * @api - */ -olx.layer.BaseOptions.prototype.opacity; - - -/** - * Visibility. Default is `true`. - * @type {boolean|undefined} - * @api - */ -olx.layer.BaseOptions.prototype.visible; - - -/** - * The bounding extent for layer rendering. The layer will not be rendered - * outside of this extent. - * @type {ol.Extent|undefined} - * @api - */ -olx.layer.BaseOptions.prototype.extent; - - -/** - * The z-index for layer rendering. At rendering time, the layers will be - * ordered, first by Z-index and then by position. The default Z-index is 0. - * @type {number|undefined} - * @api - */ -olx.layer.BaseOptions.prototype.zIndex; - - -/** - * The minimum resolution (inclusive) at which this layer will be visible. - * @type {number|undefined} - * @api - */ -olx.layer.BaseOptions.prototype.minResolution; - - -/** - * The maximum resolution (exclusive) below which this layer will be visible. - * @type {number|undefined} - * @api - */ -olx.layer.BaseOptions.prototype.maxResolution; - - /** * @typedef {{opacity: (number|undefined), * source: (ol.source.Source|undefined), diff --git a/src/ol/layer/Base.js b/src/ol/layer/Base.js index 788a4e6e59..2c5825f533 100644 --- a/src/ol/layer/Base.js +++ b/src/ol/layer/Base.js @@ -7,6 +7,22 @@ import LayerProperty from '../layer/Property.js'; import {clamp} from '../math.js'; import {assign} from '../obj.js'; + +/** + * @typedef {Object} Options + * @property {number} [opacity=1] Opacity (0, 1). + * @property {boolean} [visible=true] Visibility. + * @property {ol.Extent} [extent] The bounding extent for layer rendering. The layer will not be + * rendered outside of this extent. + * @property {number} [zIndex=0] The z-index for layer rendering. At rendering time, the layers + * will be ordered, first by Z-index and then by position. + * @property {number} [minResolution] The minimum resolution (inclusive) at which this layer will be + * visible. + * @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will + * be visible. + */ + + /** * @classdesc * Abstract base class; normally only used for creating subclasses and not @@ -18,7 +34,7 @@ import {assign} from '../obj.js'; * @constructor * @abstract * @extends {module:ol/Object~BaseObject} - * @param {olx.layer.BaseOptions} options Layer options. + * @param {module:ol/layer/Base~Options} options Layer options. * @api */ const BaseLayer = function(options) { diff --git a/src/ol/layer/Layer.js b/src/ol/layer/Layer.js index 1d1b1d6d18..064f68c20f 100644 --- a/src/ol/layer/Layer.js +++ b/src/ol/layer/Layer.js @@ -53,7 +53,7 @@ const Layer = function(options) { const baseOptions = assign({}, options); delete baseOptions.source; - BaseLayer.call(this, /** @type {olx.layer.BaseOptions} */ (baseOptions)); + BaseLayer.call(this, /** @type {module:ol/layer/Base~Options} */ (baseOptions)); /** * @private