Fix indentation
This commit is contained in:
@@ -44,7 +44,7 @@ const PARSERS = makeStructureNS(
|
||||
* @classdesc
|
||||
* Format for reading WMTS capabilities data.
|
||||
*
|
||||
* @api
|
||||
* @api
|
||||
*/
|
||||
class WMTSCapabilities extends XML {
|
||||
constructor() {
|
||||
|
||||
@@ -146,7 +146,7 @@ class SimpleGeometry extends Geometry {
|
||||
/**
|
||||
* @param {GeometryLayout} layout Layout.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
*/
|
||||
*/
|
||||
setFlatCoordinates(layout, flatCoordinates) {
|
||||
this.stride = getStrideForLayout(layout);
|
||||
this.layout = layout;
|
||||
|
||||
@@ -43,8 +43,8 @@ class BaseLayer extends BaseObject {
|
||||
super();
|
||||
|
||||
/**
|
||||
* @type {Object<string, *>}
|
||||
*/
|
||||
* @type {Object<string, *>}
|
||||
*/
|
||||
const properties = assign({}, options);
|
||||
properties[LayerProperty.OPACITY] =
|
||||
options.opacity !== undefined ? options.opacity : 1;
|
||||
@@ -59,34 +59,34 @@ class BaseLayer extends BaseObject {
|
||||
this.setProperties(properties);
|
||||
|
||||
/**
|
||||
* @type {import("./Layer.js").State}
|
||||
* @private
|
||||
*/
|
||||
* @type {import("./Layer.js").State}
|
||||
* @private
|
||||
*/
|
||||
this.state_ = /** @type {import("./Layer.js").State} */ ({
|
||||
layer: /** @type {import("./Layer.js").default} */ (this),
|
||||
managed: true
|
||||
});
|
||||
|
||||
/**
|
||||
* The layer type.
|
||||
* @type {import("../LayerType.js").default}
|
||||
* @protected;
|
||||
*/
|
||||
* The layer type.
|
||||
* @type {import("../LayerType.js").default}
|
||||
* @protected;
|
||||
*/
|
||||
this.type;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the layer type (used when creating a layer renderer).
|
||||
* @return {import("../LayerType.js").default} The layer type.
|
||||
*/
|
||||
* Get the layer type (used when creating a layer renderer).
|
||||
* @return {import("../LayerType.js").default} The layer type.
|
||||
*/
|
||||
getType() {
|
||||
return this.type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {import("./Layer.js").State} Layer state.
|
||||
*/
|
||||
* @return {import("./Layer.js").State} Layer state.
|
||||
*/
|
||||
getLayerState() {
|
||||
this.state_.opacity = clamp(this.getOpacity(), 0, 1);
|
||||
this.state_.sourceState = this.getSourceState();
|
||||
@@ -100,149 +100,149 @@ class BaseLayer extends BaseObject {
|
||||
}
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param {Array<import("./Layer.js").default>=} opt_array Array of layers (to be
|
||||
* modified in place).
|
||||
* @return {Array<import("./Layer.js").default>} Array of layers.
|
||||
*/
|
||||
* @abstract
|
||||
* @param {Array<import("./Layer.js").default>=} opt_array Array of layers (to be
|
||||
* modified in place).
|
||||
* @return {Array<import("./Layer.js").default>} Array of layers.
|
||||
*/
|
||||
getLayersArray(opt_array) {}
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param {Array<import("./Layer.js").State>=} opt_states Optional list of layer
|
||||
* states (to be modified in place).
|
||||
* @return {Array<import("./Layer.js").State>} List of layer states.
|
||||
*/
|
||||
* @abstract
|
||||
* @param {Array<import("./Layer.js").State>=} opt_states Optional list of layer
|
||||
* states (to be modified in place).
|
||||
* @return {Array<import("./Layer.js").State>} List of layer states.
|
||||
*/
|
||||
getLayerStatesArray(opt_states) {}
|
||||
|
||||
/**
|
||||
* Return the {@link module:ol/extent~Extent extent} of the layer or `undefined` if it
|
||||
* will be visible regardless of extent.
|
||||
* @return {import("../extent.js").Extent|undefined} The layer extent.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
* Return the {@link module:ol/extent~Extent extent} of the layer or `undefined` if it
|
||||
* will be visible regardless of extent.
|
||||
* @return {import("../extent.js").Extent|undefined} The layer extent.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
getExtent() {
|
||||
return (
|
||||
/** @type {import("../extent.js").Extent|undefined} */ (this.get(LayerProperty.EXTENT))
|
||||
/** @type {import("../extent.js").Extent|undefined} */ (this.get(LayerProperty.EXTENT))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the maximum resolution of the layer.
|
||||
* @return {number} The maximum resolution of the layer.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
* Return the maximum resolution of the layer.
|
||||
* @return {number} The maximum resolution of the layer.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
getMaxResolution() {
|
||||
return /** @type {number} */ (this.get(LayerProperty.MAX_RESOLUTION));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the minimum resolution of the layer.
|
||||
* @return {number} The minimum resolution of the layer.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
* Return the minimum resolution of the layer.
|
||||
* @return {number} The minimum resolution of the layer.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
getMinResolution() {
|
||||
return /** @type {number} */ (this.get(LayerProperty.MIN_RESOLUTION));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the opacity of the layer (between 0 and 1).
|
||||
* @return {number} The opacity of the layer.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
* Return the opacity of the layer (between 0 and 1).
|
||||
* @return {number} The opacity of the layer.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
getOpacity() {
|
||||
return /** @type {number} */ (this.get(LayerProperty.OPACITY));
|
||||
}
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @return {import("../source/State.js").default} Source state.
|
||||
*/
|
||||
* @abstract
|
||||
* @return {import("../source/State.js").default} Source state.
|
||||
*/
|
||||
getSourceState() {}
|
||||
|
||||
/**
|
||||
* Return the visibility of the layer (`true` or `false`).
|
||||
* @return {boolean} The visibility of the layer.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
* Return the visibility of the layer (`true` or `false`).
|
||||
* @return {boolean} The visibility of the layer.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
getVisible() {
|
||||
return /** @type {boolean} */ (this.get(LayerProperty.VISIBLE));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the Z-index of the layer, which is used to order layers before
|
||||
* rendering. The default Z-index is 0.
|
||||
* @return {number} The Z-index of the layer.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
* Return the Z-index of the layer, which is used to order layers before
|
||||
* rendering. The default Z-index is 0.
|
||||
* @return {number} The Z-index of the layer.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
getZIndex() {
|
||||
return /** @type {number} */ (this.get(LayerProperty.Z_INDEX));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the extent at which the layer is visible. If `undefined`, the layer
|
||||
* will be visible at all extents.
|
||||
* @param {import("../extent.js").Extent|undefined} extent The extent of the layer.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
* Set the extent at which the layer is visible. If `undefined`, the layer
|
||||
* will be visible at all extents.
|
||||
* @param {import("../extent.js").Extent|undefined} extent The extent of the layer.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
setExtent(extent) {
|
||||
this.set(LayerProperty.EXTENT, extent);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the maximum resolution at which the layer is visible.
|
||||
* @param {number} maxResolution The maximum resolution of the layer.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
* Set the maximum resolution at which the layer is visible.
|
||||
* @param {number} maxResolution The maximum resolution of the layer.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
setMaxResolution(maxResolution) {
|
||||
this.set(LayerProperty.MAX_RESOLUTION, maxResolution);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the minimum resolution at which the layer is visible.
|
||||
* @param {number} minResolution The minimum resolution of the layer.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
* Set the minimum resolution at which the layer is visible.
|
||||
* @param {number} minResolution The minimum resolution of the layer.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
setMinResolution(minResolution) {
|
||||
this.set(LayerProperty.MIN_RESOLUTION, minResolution);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the opacity of the layer, allowed values range from 0 to 1.
|
||||
* @param {number} opacity The opacity of the layer.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
* Set the opacity of the layer, allowed values range from 0 to 1.
|
||||
* @param {number} opacity The opacity of the layer.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
setOpacity(opacity) {
|
||||
this.set(LayerProperty.OPACITY, opacity);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the visibility of the layer (`true` or `false`).
|
||||
* @param {boolean} visible The visibility of the layer.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
* Set the visibility of the layer (`true` or `false`).
|
||||
* @param {boolean} visible The visibility of the layer.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
setVisible(visible) {
|
||||
this.set(LayerProperty.VISIBLE, visible);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Z-index of the layer, which is used to order layers before rendering.
|
||||
* The default Z-index is 0.
|
||||
* @param {number} zindex The z-index of the layer.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
* Set Z-index of the layer, which is used to order layers before rendering.
|
||||
* The default Z-index is 0.
|
||||
* @param {number} zindex The z-index of the layer.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
setZIndex(zindex) {
|
||||
this.set(LayerProperty.Z_INDEX, zindex);
|
||||
}
|
||||
|
||||
@@ -55,15 +55,15 @@ class Source extends BaseObject {
|
||||
super();
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {import("../proj/Projection.js").default}
|
||||
*/
|
||||
* @private
|
||||
* @type {import("../proj/Projection.js").default}
|
||||
*/
|
||||
this.projection_ = getProjection(options.projection);
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {?Attribution}
|
||||
*/
|
||||
* @private
|
||||
* @type {?Attribution}
|
||||
*/
|
||||
this.attributions_ = this.adaptAttributions_(options.attributions);
|
||||
|
||||
/**
|
||||
@@ -74,25 +74,25 @@ class Source extends BaseObject {
|
||||
this.loading = false;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {SourceState}
|
||||
*/
|
||||
* @private
|
||||
* @type {SourceState}
|
||||
*/
|
||||
this.state_ = options.state !== undefined ?
|
||||
options.state : SourceState.READY;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {boolean}
|
||||
*/
|
||||
* @private
|
||||
* @type {boolean}
|
||||
*/
|
||||
this.wrapX_ = options.wrapX !== undefined ? options.wrapX : false;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns the attributions option into an attributions function.
|
||||
* @param {AttributionLike|undefined} attributionLike The attribution option.
|
||||
* @return {?Attribution} An attribution function (or null).
|
||||
*/
|
||||
* Turns the attributions option into an attributions function.
|
||||
* @param {AttributionLike|undefined} attributionLike The attribution option.
|
||||
* @return {?Attribution} An attribution function (or null).
|
||||
*/
|
||||
adaptAttributions_(attributionLike) {
|
||||
if (!attributionLike) {
|
||||
return null;
|
||||
@@ -113,69 +113,69 @@ class Source extends BaseObject {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the attribution function for the source.
|
||||
* @return {?Attribution} Attribution function.
|
||||
*/
|
||||
* Get the attribution function for the source.
|
||||
* @return {?Attribution} Attribution function.
|
||||
*/
|
||||
getAttributions() {
|
||||
return this.attributions_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the projection of the source.
|
||||
* @return {import("../proj/Projection.js").default} Projection.
|
||||
* @api
|
||||
*/
|
||||
* Get the projection of the source.
|
||||
* @return {import("../proj/Projection.js").default} Projection.
|
||||
* @api
|
||||
*/
|
||||
getProjection() {
|
||||
return this.projection_;
|
||||
}
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @return {Array<number>|undefined} Resolutions.
|
||||
*/
|
||||
* @abstract
|
||||
* @return {Array<number>|undefined} Resolutions.
|
||||
*/
|
||||
getResolutions() {}
|
||||
|
||||
/**
|
||||
* Get the state of the source, see {@link module:ol/source/State~State} for possible states.
|
||||
* @return {SourceState} State.
|
||||
* @api
|
||||
*/
|
||||
* Get the state of the source, see {@link module:ol/source/State~State} for possible states.
|
||||
* @return {SourceState} State.
|
||||
* @api
|
||||
*/
|
||||
getState() {
|
||||
return this.state_;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {boolean|undefined} Wrap X.
|
||||
*/
|
||||
* @return {boolean|undefined} Wrap X.
|
||||
*/
|
||||
getWrapX() {
|
||||
return this.wrapX_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Refreshes the source and finally dispatches a 'change' event.
|
||||
* @api
|
||||
*/
|
||||
* Refreshes the source and finally dispatches a 'change' event.
|
||||
* @api
|
||||
*/
|
||||
refresh() {
|
||||
this.changed();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the attributions of the source.
|
||||
* @param {AttributionLike|undefined} attributions Attributions.
|
||||
* Can be passed as `string`, `Array<string>`, `{@link module:ol/source/Source~Attribution}`,
|
||||
* or `undefined`.
|
||||
* @api
|
||||
*/
|
||||
* Set the attributions of the source.
|
||||
* @param {AttributionLike|undefined} attributions Attributions.
|
||||
* Can be passed as `string`, `Array<string>`, `{@link module:ol/source/Source~Attribution}`,
|
||||
* or `undefined`.
|
||||
* @api
|
||||
*/
|
||||
setAttributions(attributions) {
|
||||
this.attributions_ = this.adaptAttributions_(attributions);
|
||||
this.changed();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the state of the source.
|
||||
* @param {SourceState} state State.
|
||||
* @protected
|
||||
*/
|
||||
* Set the state of the source.
|
||||
* @param {SourceState} state State.
|
||||
* @protected
|
||||
*/
|
||||
setState(state) {
|
||||
this.state_ = state;
|
||||
this.changed();
|
||||
|
||||
Reference in New Issue
Block a user