Transformed types

Using the [ts.js codemod](https://gist.github.com/tschaub/1ea498c9d1e5268cf36d212b3949be4e):

    jscodeshift --transform ts.js src
This commit is contained in:
Tim Schaub
2018-09-05 08:05:29 -06:00
parent f2aaaa19e1
commit ccfacc5ee6
239 changed files with 3999 additions and 3999 deletions
+16 -16
View File
@@ -11,7 +11,7 @@ import {assign} from '../obj.js';
* @typedef {Object} Options
* @property {number} [opacity=1] Opacity (0, 1).
* @property {boolean} [visible=true] Visibility.
* @property {module:ol/extent~Extent} [extent] The bounding extent for layer rendering. The layer will not be
* @property {import("../extent.js").Extent} [extent] The bounding extent for layer rendering. The layer will not be
* rendered outside of this extent.
* @property {number} [zIndex] The z-index for layer rendering. At rendering time, the layers
* will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed
@@ -36,7 +36,7 @@ import {assign} from '../obj.js';
*/
class BaseLayer extends BaseObject {
/**
* @param {module:ol/layer/Base~Options} options Layer options.
* @param {Options} options Layer options.
*/
constructor(options) {
@@ -59,17 +59,17 @@ class BaseLayer extends BaseObject {
this.setProperties(properties);
/**
* @type {module:ol/layer/Layer~State}
* @type {import("./Layer.js").State}
* @private
*/
this.state_ = /** @type {module:ol/layer/Layer~State} */ ({
layer: /** @type {module:ol/layer/Layer} */ (this),
this.state_ = /** @type {import("./Layer.js").State} */ ({
layer: /** @type {import("./Layer.js").default} */ (this),
managed: true
});
/**
* The layer type.
* @type {module:ol/LayerType}
* @type {import("../LayerType.js").default}
* @protected;
*/
this.type;
@@ -78,14 +78,14 @@ class BaseLayer extends BaseObject {
/**
* Get the layer type (used when creating a layer renderer).
* @return {module:ol/LayerType} The layer type.
* @return {import("../LayerType.js").default} The layer type.
*/
getType() {
return this.type;
}
/**
* @return {module:ol/layer/Layer~State} Layer state.
* @return {import("./Layer.js").State} Layer state.
*/
getLayerState() {
this.state_.opacity = clamp(this.getOpacity(), 0, 1);
@@ -101,30 +101,30 @@ class BaseLayer extends BaseObject {
/**
* @abstract
* @param {Array<module:ol/layer/Layer>=} opt_array Array of layers (to be
* @param {Array<import("./Layer.js").default>=} opt_array Array of layers (to be
* modified in place).
* @return {Array<module:ol/layer/Layer>} Array of layers.
* @return {Array<import("./Layer.js").default>} Array of layers.
*/
getLayersArray(opt_array) {}
/**
* @abstract
* @param {Array<module:ol/layer/Layer~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).
* @return {Array<module:ol/layer/Layer~State>} List of layer states.
* @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 {module:ol/extent~Extent|undefined} The layer extent.
* @return {import("../extent.js").Extent|undefined} The layer extent.
* @observable
* @api
*/
getExtent() {
return (
/** @type {module:ol/extent~Extent|undefined} */ (this.get(LayerProperty.EXTENT))
/** @type {import("../extent.js").Extent|undefined} */ (this.get(LayerProperty.EXTENT))
);
}
@@ -160,7 +160,7 @@ class BaseLayer extends BaseObject {
/**
* @abstract
* @return {module:ol/source/State} Source state.
* @return {import("../source/State.js").default} Source state.
*/
getSourceState() {}
@@ -188,7 +188,7 @@ class BaseLayer extends BaseObject {
/**
* Set the extent at which the layer is visible. If `undefined`, the layer
* will be visible at all extents.
* @param {module:ol/extent~Extent|undefined} extent The extent of the layer.
* @param {import("../extent.js").Extent|undefined} extent The extent of the layer.
* @observable
* @api
*/
+14 -14
View File
@@ -19,7 +19,7 @@ import SourceState from '../source/State.js';
* @typedef {Object} Options
* @property {number} [opacity=1] Opacity (0, 1).
* @property {boolean} [visible=true] Visibility.
* @property {module:ol/extent~Extent} [extent] The bounding extent for layer rendering. The layer will not be
* @property {import("../extent.js").Extent} [extent] The bounding extent for layer rendering. The layer will not be
* rendered outside of this extent.
* @property {number} [zIndex] The z-index for layer rendering. At rendering time, the layers
* will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed
@@ -29,7 +29,7 @@ import SourceState from '../source/State.js';
* visible.
* @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will
* be visible.
* @property {Array<module:ol/layer/Base>|module:ol/Collection<module:ol/layer/Base>} [layers] Child layers.
* @property {Array<import("./Base.js").default>|import("../Collection.js").default<import("./Base.js").default>} [layers] Child layers.
*/
@@ -52,12 +52,12 @@ const Property = {
*/
class LayerGroup extends BaseLayer {
/**
* @param {module:ol/layer/Group~Options=} opt_options Layer options.
* @param {Options=} opt_options Layer options.
*/
constructor(opt_options) {
const options = opt_options || {};
const baseOptions = /** @type {module:ol/layer/Group~Options} */ (assign({}, options));
const baseOptions = /** @type {Options} */ (assign({}, options));
delete baseOptions.layers;
let layers = options.layers;
@@ -66,13 +66,13 @@ class LayerGroup extends BaseLayer {
/**
* @private
* @type {Array<module:ol/events~EventsKey>}
* @type {Array<import("../events.js").EventsKey>}
*/
this.layersListenerKeys_ = [];
/**
* @private
* @type {Object<string, Array<module:ol/events~EventsKey>>}
* @type {Object<string, Array<import("../events.js").EventsKey>>}
*/
this.listenerKeys_ = {};
@@ -104,7 +104,7 @@ class LayerGroup extends BaseLayer {
}
/**
* @param {module:ol/events/Event} event Event.
* @param {import("../events/Event.js").default} event Event.
* @private
*/
handleLayersChanged_() {
@@ -135,11 +135,11 @@ class LayerGroup extends BaseLayer {
}
/**
* @param {module:ol/Collection~CollectionEvent} collectionEvent CollectionEvent.
* @param {import("../Collection.js").CollectionEvent} collectionEvent CollectionEvent.
* @private
*/
handleLayersAdd_(collectionEvent) {
const layer = /** @type {module:ol/layer/Base} */ (collectionEvent.element);
const layer = /** @type {import("./Base.js").default} */ (collectionEvent.element);
const key = getUid(layer).toString();
this.listenerKeys_[key] = [
listen(layer, ObjectEventType.PROPERTYCHANGE, this.handleLayerChange_, this),
@@ -149,11 +149,11 @@ class LayerGroup extends BaseLayer {
}
/**
* @param {module:ol/Collection~CollectionEvent} collectionEvent CollectionEvent.
* @param {import("../Collection.js").CollectionEvent} collectionEvent CollectionEvent.
* @private
*/
handleLayersRemove_(collectionEvent) {
const layer = /** @type {module:ol/layer/Base} */ (collectionEvent.element);
const layer = /** @type {import("./Base.js").default} */ (collectionEvent.element);
const key = getUid(layer).toString();
this.listenerKeys_[key].forEach(unlistenByKey);
delete this.listenerKeys_[key];
@@ -163,21 +163,21 @@ class LayerGroup extends BaseLayer {
/**
* Returns the {@link module:ol/Collection collection} of {@link module:ol/layer/Layer~Layer layers}
* in this group.
* @return {!module:ol/Collection<module:ol/layer/Base>} Collection of
* @return {!import("../Collection.js").default<import("./Base.js").default>} Collection of
* {@link module:ol/layer/Base layers} that are part of this group.
* @observable
* @api
*/
getLayers() {
return (
/** @type {!module:ol/Collection<module:ol/layer/Base>} */ (this.get(Property.LAYERS))
/** @type {!import("../Collection.js").default<import("./Base.js").default>} */ (this.get(Property.LAYERS))
);
}
/**
* Set the {@link module:ol/Collection collection} of {@link module:ol/layer/Layer~Layer layers}
* in this group.
* @param {!module:ol/Collection<module:ol/layer/Base>} layers Collection of
* @param {!import("../Collection.js").default<import("./Base.js").default>} layers Collection of
* {@link module:ol/layer/Base layers} that are part of this group.
* @observable
* @api
+8 -8
View File
@@ -16,7 +16,7 @@ import Style from '../style/Style.js';
* @typedef {Object} Options
* @property {number} [opacity=1] Opacity (0, 1).
* @property {boolean} [visible=true] Visibility.
* @property {module:ol/extent~Extent} [extent] The bounding extent for layer rendering. The layer will not be
* @property {import("../extent.js").Extent} [extent] The bounding extent for layer rendering. The layer will not be
* rendered outside of this extent.
* @property {number} [zIndex] The z-index for layer rendering. At rendering time, the layers
* will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed
@@ -31,15 +31,15 @@ import Style from '../style/Style.js';
* @property {number} [radius=8] Radius size in pixels.
* @property {number} [blur=15] Blur size in pixels.
* @property {number} [shadow=250] Shadow size in pixels.
* @property {string|function(module:ol/Feature):number} [weight='weight'] The feature
* @property {string|function(import("../Feature.js").default):number} [weight='weight'] The feature
* attribute to use for the weight or a function that returns a weight from a feature. Weight values
* should range from 0 to 1 (and values outside will be clamped to that range).
* @property {module:ol/layer/VectorRenderType|string} [renderMode='vector'] Render mode for vector layers:
* @property {import("./VectorRenderType.js").default|string} [renderMode='vector'] Render mode for vector layers:
* * `'image'`: Vector layers are rendered as images. Great performance, but point symbols and
* texts are always rotated with the view and pixels are scaled during zoom animations.
* * `'vector'`: Vector layers are rendered as vectors. Most accurate rendering even during
* animations, but slower performance.
* @property {module:ol/source/Vector} [source] Source.
* @property {import("../source/Vector.js").default} [source] Source.
*/
@@ -68,12 +68,12 @@ const DEFAULT_GRADIENT = ['#00f', '#0ff', '#0f0', '#ff0', '#f00'];
* property on the layer object; for example, setting `title: 'My Title'` in the
* options means that `title` is observable, and has get/set accessors.
*
* @fires module:ol/render/Event~RenderEvent
* @fires import("../render/Event.js").RenderEvent
* @api
*/
class Heatmap extends VectorLayer {
/**
* @param {module:ol/layer/Heatmap~Options=} opt_options Options.
* @param {Options=} opt_options Options.
*/
constructor(opt_options) {
const options = opt_options ? opt_options : {};
@@ -107,7 +107,7 @@ class Heatmap extends VectorLayer {
/**
* @private
* @type {Array<Array<module:ol/style/Style>>}
* @type {Array<Array<import("../style/Style.js").default>>}
*/
this.styleCache_ = null;
@@ -234,7 +234,7 @@ class Heatmap extends VectorLayer {
}
/**
* @param {module:ol/render/Event} event Post compose event
* @param {import("../render/Event.js").default} event Post compose event
* @private
*/
handleRender_(event) {
+7 -7
View File
@@ -9,7 +9,7 @@ import Layer from '../layer/Layer.js';
* @typedef {Object} Options
* @property {number} [opacity=1] Opacity (0, 1).
* @property {boolean} [visible=true] Visibility.
* @property {module:ol/extent~Extent} [extent] The bounding extent for layer rendering. The layer will not be
* @property {import("../extent.js").Extent} [extent] The bounding extent for layer rendering. The layer will not be
* rendered outside of this extent.
* @property {number} [zIndex] The z-index for layer rendering. At rendering time, the layers
* will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed
@@ -19,11 +19,11 @@ import Layer from '../layer/Layer.js';
* visible.
* @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will
* be visible.
* @property {module:ol/PluggableMap} [map] Sets the layer as overlay on a map. The map will not manage
* @property {import("../PluggableMap.js").default} [map] Sets the layer as overlay on a map. The map will not manage
* this layer in its layers collection, and the layer will be rendered on top. This is useful for
* temporary layers. The standard way to add a layer to a map and have it managed by the map is to
* use {@link module:ol/Map#addLayer}.
* @property {module:ol/source/Image} [source] Source for this layer.
* @property {import("../source/Image.js").default} [source] Source for this layer.
*/
@@ -35,13 +35,13 @@ import Layer from '../layer/Layer.js';
* property on the layer object; for example, setting `title: 'My Title'` in the
* options means that `title` is observable, and has get/set accessors.
*
* @fires module:ol/render/Event~RenderEvent
* @fires import("../render/Event.js").RenderEvent
* @api
*/
class ImageLayer extends Layer {
/**
* @param {module:ol/layer/Image~Options=} opt_options Layer options.
* @param {Options=} opt_options Layer options.
*/
constructor(opt_options) {
const options = opt_options ? opt_options : {};
@@ -50,7 +50,7 @@ class ImageLayer extends Layer {
/**
* The layer type.
* @protected
* @type {module:ol/LayerType}
* @type {import("../LayerType.js").default}
*/
this.type = LayerType.IMAGE;
@@ -62,7 +62,7 @@ class ImageLayer extends Layer {
/**
* Return the associated {@link module:ol/source/Image source} of the image layer.
* @function
* @return {module:ol/source/Image} Source.
* @return {import("../source/Image.js").default} Source.
* @api
*/
ImageLayer.prototype.getSource;
+15 -15
View File
@@ -16,7 +16,7 @@ import SourceState from '../source/State.js';
* @typedef {Object} Options
* @property {number} [opacity=1] Opacity (0, 1).
* @property {boolean} [visible=true] Visibility.
* @property {module:ol/extent~Extent} [extent] The bounding extent for layer rendering. The layer will not be
* @property {import("../extent.js").Extent} [extent] The bounding extent for layer rendering. The layer will not be
* rendered outside of this extent.
* @property {number} [zIndex] The z-index for layer rendering. At rendering time, the layers
* will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed
@@ -26,7 +26,7 @@ import SourceState from '../source/State.js';
* visible.
* @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will
* be visible.
* @property {module:ol/source/Source} [source] Source for this layer. If not provided to the constructor,
* @property {import("../source/Source.js").default} [source] Source for this layer. If not provided to the constructor,
* the source can be set by calling {@link module:ol/layer/Layer#setSource layer.setSource(source)} after
* construction.
*/
@@ -34,12 +34,12 @@ import SourceState from '../source/State.js';
/**
* @typedef {Object} State
* @property {module:ol/layer/Layer} layer
* @property {import("./Layer.js").default} layer
* @property {number} opacity
* @property {module:ol/source/Source~State} sourceState
* @property {import("../source/Source.js").State} sourceState
* @property {boolean} visible
* @property {boolean} managed
* @property {module:ol/extent~Extent} [extent]
* @property {import("../extent.js").Extent} [extent]
* @property {number} zIndex
* @property {number} maxResolution
* @property {number} minResolution
@@ -60,11 +60,11 @@ import SourceState from '../source/State.js';
*
* A generic `change` event is fired when the state of the source changes.
*
* @fires module:ol/render/Event~RenderEvent
* @fires import("../render/Event.js").RenderEvent
*/
class Layer extends BaseLayer {
/**
* @param {module:ol/layer/Layer~Options} options Layer options.
* @param {Options} options Layer options.
*/
constructor(options) {
@@ -75,19 +75,19 @@ class Layer extends BaseLayer {
/**
* @private
* @type {?module:ol/events~EventsKey}
* @type {?import("../events.js").EventsKey}
*/
this.mapPrecomposeKey_ = null;
/**
* @private
* @type {?module:ol/events~EventsKey}
* @type {?import("../events.js").EventsKey}
*/
this.mapRenderKey_ = null;
/**
* @private
* @type {?module:ol/events~EventsKey}
* @type {?import("../events.js").EventsKey}
*/
this.sourceChangeKey_ = null;
@@ -123,14 +123,14 @@ class Layer extends BaseLayer {
/**
* Get the layer source.
* @return {module:ol/source/Source} The layer source (or `null` if not yet set).
* @return {import("../source/Source.js").default} The layer source (or `null` if not yet set).
* @observable
* @api
*/
getSource() {
const source = this.get(LayerProperty.SOURCE);
return (
/** @type {module:ol/source/Source} */ (source) || null
/** @type {import("../source/Source.js").default} */ (source) || null
);
}
@@ -174,7 +174,7 @@ class Layer extends BaseLayer {
*
* To add the layer to a map and have it managed by the map, use
* {@link module:ol/Map#addLayer} instead.
* @param {module:ol/PluggableMap} map Map.
* @param {import("../PluggableMap.js").default} map Map.
* @api
*/
setMap(map) {
@@ -206,7 +206,7 @@ class Layer extends BaseLayer {
/**
* Set the layer source.
* @param {module:ol/source/Source} source The layer source.
* @param {import("../source/Source.js").default} source The layer source.
* @observable
* @api
*/
@@ -220,7 +220,7 @@ class Layer extends BaseLayer {
* Return `true` if the layer is visible, and if the passed resolution is
* between the layer's minResolution and maxResolution. The comparison is
* inclusive for `minResolution` and exclusive for `maxResolution`.
* @param {module:ol/layer/Layer~State} layerState Layer state.
* @param {State} layerState Layer state.
* @param {number} resolution Resolution.
* @return {boolean} The layer is visible at the given resolution.
*/
+6 -6
View File
@@ -11,7 +11,7 @@ import {assign} from '../obj.js';
* @typedef {Object} Options
* @property {number} [opacity=1] Opacity (0, 1).
* @property {boolean} [visible=true] Visibility.
* @property {module:ol/extent~Extent} [extent] The bounding extent for layer rendering. The layer will not be
* @property {import("../extent.js").Extent} [extent] The bounding extent for layer rendering. The layer will not be
* rendered outside of this extent.
* @property {number} [zIndex] The z-index for layer rendering. At rendering time, the layers
* will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed
@@ -23,8 +23,8 @@ import {assign} from '../obj.js';
* be visible.
* @property {number} [preload=0] Preload. Load low-resolution tiles up to `preload` levels. `0`
* means no preloading.
* @property {module:ol/source/Tile} [source] Source for this layer.
* @property {module:ol/PluggableMap} [map] Sets the layer as overlay on a map. The map will not manage
* @property {import("../source/Tile.js").default} [source] Source for this layer.
* @property {import("../PluggableMap.js").default} [map] Sets the layer as overlay on a map. The map will not manage
* this layer in its layers collection, and the layer will be rendered on top. This is useful for
* temporary layers. The standard way to add a layer to a map and have it managed by the map is to
* use {@link module:ol/Map#addLayer}.
@@ -43,7 +43,7 @@ import {assign} from '../obj.js';
*/
class TileLayer extends Layer {
/**
* @param {module:ol/layer/Tile~Options=} opt_options Tile layer options.
* @param {Options=} opt_options Tile layer options.
*/
constructor(opt_options) {
const options = opt_options ? opt_options : {};
@@ -61,7 +61,7 @@ class TileLayer extends Layer {
/**
* The layer type.
* @protected
* @type {module:ol/LayerType}
* @type {import("../LayerType.js").default}
*/
this.type = LayerType.TILE;
@@ -112,7 +112,7 @@ class TileLayer extends Layer {
/**
* Return the associated {@link module:ol/source/Tile tilesource} of the layer.
* @function
* @return {module:ol/source/Tile} Source.
* @return {import("../source/Tile.js").default} Source.
* @api
*/
TileLayer.prototype.getSource;
+20 -20
View File
@@ -12,7 +12,7 @@ import {createDefaultStyle, toFunction as toStyleFunction} from '../style/Style.
* @typedef {Object} Options
* @property {number} [opacity=1] Opacity (0, 1).
* @property {boolean} [visible=true] Visibility.
* @property {module:ol/extent~Extent} [extent] The bounding extent for layer rendering. The layer will not be
* @property {import("../extent.js").Extent} [extent] The bounding extent for layer rendering. The layer will not be
* rendered outside of this extent.
* @property {number} [zIndex] The z-index for layer rendering. At rendering time, the layers
* will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed
@@ -22,26 +22,26 @@ import {createDefaultStyle, toFunction as toStyleFunction} from '../style/Style.
* visible.
* @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will
* be visible.
* @property {module:ol/render~OrderFunction} [renderOrder] Render order. Function to be used when sorting
* @property {import("../render.js").OrderFunction} [renderOrder] Render order. Function to be used when sorting
* features before rendering. By default features are drawn in the order that they are created. Use
* `null` to avoid the sort, but get an undefined draw order.
* @property {number} [renderBuffer=100] The buffer in pixels around the viewport extent used by the
* renderer when getting features from the vector source for the rendering or hit-detection.
* Recommended value: the size of the largest symbol, line width or label.
* @property {module:ol/layer/VectorRenderType|string} [renderMode='vector'] Render mode for vector layers:
* @property {import("./VectorRenderType.js").default|string} [renderMode='vector'] Render mode for vector layers:
* * `'image'`: Vector layers are rendered as images. Great performance, but point symbols and
* texts are always rotated with the view and pixels are scaled during zoom animations.
* * `'vector'`: Vector layers are rendered as vectors. Most accurate rendering even during
* animations, but slower performance.
* @property {module:ol/source/Vector} [source] Source.
* @property {module:ol/PluggableMap} [map] Sets the layer as overlay on a map. The map will not manage
* @property {import("../source/Vector.js").default} [source] Source.
* @property {import("../PluggableMap.js").default} [map] Sets the layer as overlay on a map. The map will not manage
* this layer in its layers collection, and the layer will be rendered on top. This is useful for
* temporary layers. The standard way to add a layer to a map and have it managed by the map is to
* use {@link module:ol/Map#addLayer}.
* @property {boolean} [declutter=false] Declutter images and text. Decluttering is applied to all
* image and text styles, and the priority is defined by the z-index of the style. Lower z-index
* means higher priority.
* @property {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style] Layer style. See
* @property {import("../style/Style.js").default|Array<import("../style/Style.js").default>|import("../style/Style.js").StyleFunction} [style] Layer style. See
* {@link module:ol/style} for default style which will be used if this is not defined.
* @property {boolean} [updateWhileAnimating=false] When set to `true` and `renderMode`
* is `vector`, feature batches will be recreated during animations. This means that no
@@ -90,11 +90,11 @@ const Property = {
*/
class VectorLayer extends Layer {
/**
* @param {module:ol/layer/Vector~Options=} opt_options Options.
* @param {Options=} opt_options Options.
*/
constructor(opt_options) {
const options = opt_options ?
opt_options : /** @type {module:ol/layer/Vector~Options} */ ({});
opt_options : /** @type {Options} */ ({});
const baseOptions = assign({}, options);
@@ -119,14 +119,14 @@ class VectorLayer extends Layer {
/**
* User provided style.
* @type {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction}
* @type {import("../style/Style.js").default|Array<import("../style/Style.js").default>|import("../style/Style.js").StyleFunction}
* @private
*/
this.style_ = null;
/**
* Style function for use within the library.
* @type {module:ol/style/Style~StyleFunction|undefined}
* @type {import("../style/Style.js").StyleFunction|undefined}
* @private
*/
this.styleFunction_ = undefined;
@@ -149,14 +149,14 @@ class VectorLayer extends Layer {
/**
* @private
* @type {module:ol/layer/VectorTileRenderType|string}
* @type {import("./VectorTileRenderType.js").default|string}
*/
this.renderMode_ = options.renderMode || VectorRenderType.VECTOR;
/**
* The layer type.
* @protected
* @type {module:ol/LayerType}
* @type {import("../LayerType.js").default}
*/
this.type = LayerType.VECTOR;
@@ -184,19 +184,19 @@ class VectorLayer extends Layer {
}
/**
* @return {function(module:ol/Feature, module:ol/Feature): number|null|undefined} Render
* @return {function(import("../Feature.js").default, import("../Feature.js").default): number|null|undefined} Render
* order.
*/
getRenderOrder() {
return (
/** @type {module:ol/render~OrderFunction|null|undefined} */ (this.get(Property.RENDER_ORDER))
/** @type {import("../render.js").OrderFunction|null|undefined} */ (this.get(Property.RENDER_ORDER))
);
}
/**
* Get the style for features. This returns whatever was passed to the `style`
* option at construction or to the `setStyle` method.
* @return {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction}
* @return {import("../style/Style.js").default|Array<import("../style/Style.js").default>|import("../style/Style.js").StyleFunction}
* Layer style.
* @api
*/
@@ -206,7 +206,7 @@ class VectorLayer extends Layer {
/**
* Get the style function.
* @return {module:ol/style/Style~StyleFunction|undefined} Layer style function.
* @return {import("../style/Style.js").StyleFunction|undefined} Layer style function.
* @api
*/
getStyleFunction() {
@@ -230,7 +230,7 @@ class VectorLayer extends Layer {
}
/**
* @param {module:ol/render~OrderFunction|null|undefined} renderOrder
* @param {import("../render.js").OrderFunction|null|undefined} renderOrder
* Render order.
*/
setRenderOrder(renderOrder) {
@@ -244,7 +244,7 @@ class VectorLayer extends Layer {
* it is `null` the layer has no style (a `null` style), so only features
* that have their own styles will be rendered in the layer. See
* {@link module:ol/style} for information on the default style.
* @param {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction|null|undefined} style Layer style.
* @param {import("../style/Style.js").default|Array<import("../style/Style.js").default>|import("../style/Style.js").StyleFunction|null|undefined} style Layer style.
* @api
*/
setStyle(style) {
@@ -255,7 +255,7 @@ class VectorLayer extends Layer {
}
/**
* @return {module:ol/layer/VectorRenderType|string} The render mode.
* @return {import("./VectorRenderType.js").default|string} The render mode.
*/
getRenderMode() {
return this.renderMode_;
@@ -266,7 +266,7 @@ class VectorLayer extends Layer {
/**
* Return the associated {@link module:ol/source/Vector vectorsource} of the layer.
* @function
* @return {module:ol/source/Vector} Source.
* @return {import("../source/Vector.js").default} Source.
* @api
*/
VectorLayer.prototype.getSource;
+12 -12
View File
@@ -33,7 +33,7 @@ export const RenderType = {
* @typedef {Object} Options
* @property {number} [opacity=1] Opacity (0, 1).
* @property {boolean} [visible=true] Visibility.
* @property {module:ol/extent~Extent} [extent] The bounding extent for layer rendering. The layer will not be
* @property {import("../extent.js").Extent} [extent] The bounding extent for layer rendering. The layer will not be
* rendered outside of this extent.
* @property {number} [zIndex] The z-index for layer rendering. At rendering time, the layers
* will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed
@@ -43,7 +43,7 @@ export const RenderType = {
* visible.
* @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will
* be visible.
* @property {module:ol/render~OrderFunction} [renderOrder] Render order. Function to be used when sorting
* @property {import("../render.js").OrderFunction} [renderOrder] Render order. Function to be used when sorting
* features before rendering. By default features are drawn in the order that they are created. Use
* `null` to avoid the sort, but get an undefined draw order.
* @property {number} [renderBuffer=100] The buffer in pixels around the tile extent used by the
@@ -51,7 +51,7 @@ export const RenderType = {
* Recommended value: Vector tiles are usually generated with a buffer, so this value should match
* the largest possible buffer of the used tiles. It should be at least the size of the largest
* point symbol or line width.
* @property {module:ol/layer/VectorTileRenderType|string} [renderMode='hybrid'] Render mode for vector tiles:
* @property {import("./VectorTileRenderType.js").default|string} [renderMode='hybrid'] Render mode for vector tiles:
* * `'image'`: Vector tiles are rendered as images. Great performance, but point symbols and texts
* are always rotated with the view and pixels are scaled during zoom animations.
* * `'hybrid'`: Polygon and line elements are rendered as images, so pixels are scaled during zoom
@@ -61,8 +61,8 @@ export const RenderType = {
* animations, but slower performance than the other options.
*
* When `declutter` is set to `true`, `'hybrid'` will be used instead of `'image'`.
* @property {module:ol/source/VectorTile} [source] Source.
* @property {module:ol/PluggableMap} [map] Sets the layer as overlay on a map. The map will not manage
* @property {import("../source/VectorTile.js").default} [source] Source.
* @property {import("../PluggableMap.js").default} [map] Sets the layer as overlay on a map. The map will not manage
* this layer in its layers collection, and the layer will be rendered on top. This is useful for
* temporary layers. The standard way to add a layer to a map and have it managed by the map is to
* use {@link module:ol/Map#addLayer}.
@@ -70,7 +70,7 @@ export const RenderType = {
* image and text styles, and the priority is defined by the z-index of the style. Lower z-index
* means higher priority. When set to `true`, a `renderMode` of `'image'` will be overridden with
* `'hybrid'`.
* @property {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style] Layer style. See
* @property {import("../style/Style.js").default|Array<import("../style/Style.js").default>|import("../style/Style.js").StyleFunction} [style] Layer style. See
* {@link module:ol/style} for default style which will be used if this is not defined.
* @property {boolean} [updateWhileAnimating=false] When set to `true`, feature batches will be
* recreated during animations. This means that no vectors will be shown clipped, but the setting
@@ -80,9 +80,9 @@ export const RenderType = {
* recreated during interactions. See also `updateWhileAnimating`.
* @property {number} [preload=0] Preload. Load low-resolution tiles up to `preload` levels. `0`
* means no preloading.
* @property {module:ol/render~OrderFunction} [renderOrder] Render order. Function to be used when sorting
* @property {import("../render.js").OrderFunction} [renderOrder] Render order. Function to be used when sorting
* features before rendering. By default features are drawn in the order that they are created.
* @property {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style] Layer style. See
* @property {import("../style/Style.js").default|Array<import("../style/Style.js").default>|import("../style/Style.js").StyleFunction} [style] Layer style. See
* {@link module:ol/style} for default style which will be used if this is not defined.
* @property {boolean} [useInterimTilesOnError=true] Use interim tiles on error.
*/
@@ -95,12 +95,12 @@ export const RenderType = {
* property on the layer object; for example, setting `title: 'My Title'` in the
* options means that `title` is observable, and has get/set accessors.
*
* @param {module:ol/layer/VectorTile~Options=} opt_options Options.
* @param {Options=} opt_options Options.
* @api
*/
class VectorTileLayer extends VectorLayer {
/**
* @param {module:ol/layer/VectorTile~Options=} opt_options Options.
* @param {Options=} opt_options Options.
*/
constructor(opt_options) {
const options = opt_options ? opt_options : {};
@@ -129,7 +129,7 @@ class VectorTileLayer extends VectorLayer {
/**
* The layer type.
* @protected
* @type {module:ol/LayerType}
* @type {import("../LayerType.js").default}
*/
this.type = LayerType.VECTOR_TILE;
@@ -180,7 +180,7 @@ class VectorTileLayer extends VectorLayer {
/**
* Return the associated {@link module:ol/source/VectorTile vectortilesource} of the layer.
* @function
* @return {module:ol/source/VectorTile} Source.
* @return {import("../source/VectorTile.js").default} Source.
* @api
*/
VectorTileLayer.prototype.getSource;