Move olx.layer.LayerOptions to ol/layer/Layer
This commit is contained in:
@@ -5,78 +5,6 @@
|
|||||||
let olx;
|
let olx;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @typedef {{opacity: (number|undefined),
|
|
||||||
* source: (ol.source.Source|undefined),
|
|
||||||
* visible: (boolean|undefined),
|
|
||||||
* extent: (ol.Extent|undefined),
|
|
||||||
* zIndex: (number|undefined),
|
|
||||||
* minResolution: (number|undefined),
|
|
||||||
* maxResolution: (number|undefined)}}
|
|
||||||
*/
|
|
||||||
olx.layer.LayerOptions;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Opacity (0, 1). Default is `1`.
|
|
||||||
* @type {number|undefined}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.layer.LayerOptions.prototype.opacity;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Source for this layer. If not provided to the constructor, the source can
|
|
||||||
* be set by calling {@link ol.layer.Layer#setSource layer.setSource(source)}
|
|
||||||
* after construction.
|
|
||||||
* @type {ol.source.Source|undefined}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.layer.LayerOptions.prototype.source;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Visibility. Default is `true` (visible).
|
|
||||||
* @type {boolean|undefined}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.layer.LayerOptions.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.LayerOptions.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.LayerOptions.prototype.zIndex;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The minimum resolution (inclusive) at which this layer will be visible.
|
|
||||||
* @type {number|undefined}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.layer.LayerOptions.prototype.minResolution;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The maximum resolution (exclusive) below which this layer will be visible.
|
|
||||||
* @type {number|undefined}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.layer.LayerOptions.prototype.maxResolution;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {{opacity: (number|undefined),
|
* @typedef {{opacity: (number|undefined),
|
||||||
* visible: (boolean|undefined),
|
* visible: (boolean|undefined),
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import Layer from '../layer/Layer.js';
|
|||||||
*/
|
*/
|
||||||
const ImageLayer = function(opt_options) {
|
const ImageLayer = function(opt_options) {
|
||||||
const options = opt_options ? opt_options : {};
|
const options = opt_options ? opt_options : {};
|
||||||
Layer.call(this, /** @type {olx.layer.LayerOptions} */ (options));
|
Layer.call(this, /** @type {module:ol/layer/Layer~Options} */ (options));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The layer type.
|
* The layer type.
|
||||||
|
|||||||
+19
-1
@@ -12,6 +12,24 @@ import RenderEventType from '../render/EventType.js';
|
|||||||
import SourceState from '../source/State.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 {ol.source.Source} [source] Source for this layer. If not provided to the constructor,
|
||||||
|
* the source can be set by calling {@link ol.layer.Layer#setSource layer.setSource(source)} after
|
||||||
|
* construction.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} State
|
* @typedef {Object} State
|
||||||
* @property {module:ol/layer/Layer~Layer} layer
|
* @property {module:ol/layer/Layer~Layer} layer
|
||||||
@@ -45,7 +63,7 @@ import SourceState from '../source/State.js';
|
|||||||
* @abstract
|
* @abstract
|
||||||
* @extends {module:ol/layer/Base~BaseLayer}
|
* @extends {module:ol/layer/Base~BaseLayer}
|
||||||
* @fires ol.render.Event
|
* @fires ol.render.Event
|
||||||
* @param {olx.layer.LayerOptions} options Layer options.
|
* @param {module:ol/layer/Layer~Options} options Layer options.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
const Layer = function(options) {
|
const Layer = function(options) {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ const TileLayer = function(opt_options) {
|
|||||||
|
|
||||||
delete baseOptions.preload;
|
delete baseOptions.preload;
|
||||||
delete baseOptions.useInterimTilesOnError;
|
delete baseOptions.useInterimTilesOnError;
|
||||||
Layer.call(this, /** @type {olx.layer.LayerOptions} */ (baseOptions));
|
Layer.call(this, /** @type {module:ol/layer/Layer~Options} */ (baseOptions));
|
||||||
|
|
||||||
this.setPreload(options.preload !== undefined ? options.preload : 0);
|
this.setPreload(options.preload !== undefined ? options.preload : 0);
|
||||||
this.setUseInterimTilesOnError(options.useInterimTilesOnError !== undefined ?
|
this.setUseInterimTilesOnError(options.useInterimTilesOnError !== undefined ?
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ const VectorLayer = function(opt_options) {
|
|||||||
delete baseOptions.renderBuffer;
|
delete baseOptions.renderBuffer;
|
||||||
delete baseOptions.updateWhileAnimating;
|
delete baseOptions.updateWhileAnimating;
|
||||||
delete baseOptions.updateWhileInteracting;
|
delete baseOptions.updateWhileInteracting;
|
||||||
Layer.call(this, /** @type {olx.layer.LayerOptions} */ (baseOptions));
|
Layer.call(this, /** @type {module:ol/layer/Layer~Options} */ (baseOptions));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
|
|||||||
Reference in New Issue
Block a user