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