Move olx.layer.GroupOptions to ol/layer/Group
This commit is contained in:
@@ -5,76 +5,6 @@
|
||||
let olx;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{opacity: (number|undefined),
|
||||
* visible: (boolean|undefined),
|
||||
* extent: (ol.Extent|undefined),
|
||||
* zIndex: (number|undefined),
|
||||
* minResolution: (number|undefined),
|
||||
* maxResolution: (number|undefined),
|
||||
* layers: (Array.<ol.layer.Base>|ol.Collection.<ol.layer.Base>|undefined)}}
|
||||
*/
|
||||
olx.layer.GroupOptions;
|
||||
|
||||
|
||||
/**
|
||||
* Opacity (0, 1). Default is `1`.
|
||||
* @type {number|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.layer.GroupOptions.prototype.opacity;
|
||||
|
||||
|
||||
/**
|
||||
* Visibility. Default is `true`.
|
||||
* @type {boolean|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.layer.GroupOptions.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.GroupOptions.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.GroupOptions.prototype.zIndex;
|
||||
|
||||
|
||||
/**
|
||||
* The minimum resolution (inclusive) at which this layer will be visible.
|
||||
* @type {number|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.layer.GroupOptions.prototype.minResolution;
|
||||
|
||||
|
||||
/**
|
||||
* The maximum resolution (exclusive) below which this layer will be visible.
|
||||
* @type {number|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.layer.GroupOptions.prototype.maxResolution;
|
||||
|
||||
|
||||
/**
|
||||
* Child layers.
|
||||
* @type {Array.<ol.layer.Base>|ol.Collection.<ol.layer.Base>|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.layer.GroupOptions.prototype.layers;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{gradient: (Array.<string>|undefined),
|
||||
* radius: (number|undefined),
|
||||
|
||||
@@ -15,6 +15,22 @@ import {assign, clear} from '../obj.js';
|
||||
import SourceState from '../source/State.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.
|
||||
* @property {(Array.<ol.layer.Base>|ol.Collection.<ol.layer.Base>)} [layers] Child layers.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @enum {string}
|
||||
* @private
|
||||
@@ -32,13 +48,13 @@ const Property = {
|
||||
*
|
||||
* @constructor
|
||||
* @extends {module:ol/layer/Base~BaseLayer}
|
||||
* @param {olx.layer.GroupOptions=} opt_options Layer options.
|
||||
* @param {module:ol/layer/Group~Options=} opt_options Layer options.
|
||||
* @api
|
||||
*/
|
||||
const LayerGroup = function(opt_options) {
|
||||
|
||||
const options = opt_options || {};
|
||||
const baseOptions = /** @type {olx.layer.GroupOptions} */ (assign({}, options));
|
||||
const baseOptions = /** @type {module:ol/layer/Group~Options} */ (assign({}, options));
|
||||
delete baseOptions.layers;
|
||||
|
||||
let layers = options.layers;
|
||||
|
||||
Reference in New Issue
Block a user