Shorter module paths for default exports

This commit is contained in:
ahocevar
2018-04-25 17:23:56 +02:00
parent 6cb115d6a4
commit 440d1ad3e1
233 changed files with 2136 additions and 2042 deletions
+8 -6
View File
@@ -28,12 +28,12 @@ import {assign} from '../obj.js';
* Abstract base class; normally only used for creating subclasses and not
* instantiated in apps.
* Note that with `module:ol/layer/Base~BaseLayer` and all its subclasses, any property set in
* the options is set as a {@link module:ol/Object~BaseObject property on the layer object, so
* the options is set as a {@link module:ol/Object property on the layer object, so
* is observable, and has get/set accessors.
*
* @constructor
* @abstract
* @extends {module:ol/Object~BaseObject}
* @extends {module:ol/Object}
* @param {module:ol/layer/Base~Options} options Layer options.
* @api
*/
@@ -63,7 +63,7 @@ const BaseLayer = function(options) {
* @private
*/
this.state_ = /** @type {module:ol/layer/Layer~State} */ ({
layer: /** @type {module:ol/layer/Layer~Layer} */ (this),
layer: /** @type {module:ol/layer/Layer} */ (this),
managed: true
});
@@ -106,9 +106,9 @@ BaseLayer.prototype.getLayerState = function() {
/**
* @abstract
* @param {Array.<module:ol/layer/Layer~Layer>=} opt_array Array of layers (to be
* @param {Array.<module:ol/layer/Layer>=} opt_array Array of layers (to be
* modified in place).
* @return {Array.<module:ol/layer/Layer~Layer>} Array of layers.
* @return {Array.<module:ol/layer/Layer>} Array of layers.
*/
BaseLayer.prototype.getLayersArray = function(opt_array) {};
@@ -130,7 +130,9 @@ BaseLayer.prototype.getLayerStatesArray = function(opt_states) {};
* @api
*/
BaseLayer.prototype.getExtent = function() {
return /** @type {module:ol/extent~Extent|undefined} */ (this.get(LayerProperty.EXTENT));
return (
/** @type {module:ol/extent~Extent|undefined} */ (this.get(LayerProperty.EXTENT))
);
};
+14 -12
View File
@@ -27,7 +27,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~BaseLayer>|module:ol/Collection~Collection.<module:ol/layer/Base~BaseLayer>)} [layers] Child layers.
* @property {(Array.<module:ol/layer/Base>|module:ol/Collection.<module:ol/layer/Base>)} [layers] Child layers.
*/
@@ -47,7 +47,7 @@ const Property = {
* A generic `change` event is triggered when the group/Collection changes.
*
* @constructor
* @extends {module:ol/layer/Base~BaseLayer}
* @extends {module:ol/layer/Base}
* @param {module:ol/layer/Group~Options=} opt_options Layer options.
* @api
*/
@@ -105,7 +105,7 @@ LayerGroup.prototype.handleLayerChange_ = function() {
/**
* @param {module:ol/events/Event~Event} event Event.
* @param {module:ol/events/Event} event Event.
* @private
*/
LayerGroup.prototype.handleLayersChanged_ = function(event) {
@@ -141,7 +141,7 @@ LayerGroup.prototype.handleLayersChanged_ = function(event) {
* @private
*/
LayerGroup.prototype.handleLayersAdd_ = function(collectionEvent) {
const layer = /** @type {module:ol/layer/Base~BaseLayer} */ (collectionEvent.element);
const layer = /** @type {module:ol/layer/Base} */ (collectionEvent.element);
const key = getUid(layer).toString();
this.listenerKeys_[key] = [
listen(layer, ObjectEventType.PROPERTYCHANGE, this.handleLayerChange_, this),
@@ -156,7 +156,7 @@ LayerGroup.prototype.handleLayersAdd_ = function(collectionEvent) {
* @private
*/
LayerGroup.prototype.handleLayersRemove_ = function(collectionEvent) {
const layer = /** @type {module:ol/layer/Base~BaseLayer} */ (collectionEvent.element);
const layer = /** @type {module:ol/layer/Base} */ (collectionEvent.element);
const key = getUid(layer).toString();
this.listenerKeys_[key].forEach(unlistenByKey);
delete this.listenerKeys_[key];
@@ -165,23 +165,25 @@ LayerGroup.prototype.handleLayersRemove_ = function(collectionEvent) {
/**
* Returns the {@link module:ol/Collection~Collection collection} of {@link module:ol/layer/Layer~Layer layers}
* Returns the {@link module:ol/Collection collection} of {@link module:ol/layer/Layer~Layer layers}
* in this group.
* @return {!module:ol/Collection~Collection.<module:ol/layer/Base~BaseLayer>} Collection of
* {@link module:ol/layer/Base~BaseLayer layers} that are part of this group.
* @return {!module:ol/Collection.<module:ol/layer/Base>} Collection of
* {@link module:ol/layer/Base layers} that are part of this group.
* @observable
* @api
*/
LayerGroup.prototype.getLayers = function() {
return /** @type {!module:ol/Collection~Collection.<module:ol/layer/Base~BaseLayer>} */ (this.get(Property.LAYERS));
return (
/** @type {!module:ol/Collection.<module:ol/layer/Base>} */ (this.get(Property.LAYERS))
);
};
/**
* Set the {@link module:ol/Collection~Collection collection} of {@link module:ol/layer/Layer~Layer layers}
* Set the {@link module:ol/Collection collection} of {@link module:ol/layer/Layer~Layer layers}
* in this group.
* @param {!module:ol/Collection~Collection.<module:ol/layer/Base~BaseLayer>} layers Collection of
* {@link module:ol/layer/Base~BaseLayer layers} that are part of this group.
* @param {!module:ol/Collection.<module:ol/layer/Base>} layers Collection of
* {@link module:ol/layer/Base layers} that are part of this group.
* @observable
* @api
*/
+5 -5
View File
@@ -30,10 +30,10 @@ 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~Feature):number} [weight='weight'] The feature
* @property {string|function(module:ol/Feature):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/source/Vector~VectorSource} [source] Source.
* @property {module:ol/source/Vector} [source] Source.
*/
@@ -63,7 +63,7 @@ const DEFAULT_GRADIENT = ['#00f', '#0ff', '#0f0', '#ff0', '#f00'];
* options means that `title` is observable, and has get/set accessors.
*
* @constructor
* @extends {module:ol/layer/Vector~VectorLayer}
* @extends {module:ol/layer/Vector}
* @fires module:ol/render/Event~RenderEvent
* @param {module:ol/layer/Heatmap~Options=} opt_options Options.
* @api
@@ -100,7 +100,7 @@ const Heatmap = function(opt_options) {
/**
* @private
* @type {Array.<Array.<module:ol/style/Style~Style>>}
* @type {Array.<Array.<module:ol/style/Style>>}
*/
this.styleCache_ = null;
@@ -259,7 +259,7 @@ Heatmap.prototype.handleStyleChanged_ = function() {
/**
* @param {module:ol/render/Event~RenderEvent} event Post compose event
* @param {module:ol/render/Event} event Post compose event
* @private
*/
Heatmap.prototype.handleRender_ = function(event) {
+5 -5
View File
@@ -18,11 +18,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~PluggableMap} [map] Sets the layer as overlay on a map. The map will not manage
* @property {module:ol/PluggableMap} [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 ol.Map#addLayer}.
* @property {module:ol/source/Image~ImageSource} [source] Source for this layer.
* @property {module:ol/source/Image} [source] Source for this layer.
*/
@@ -35,7 +35,7 @@ import Layer from '../layer/Layer.js';
* options means that `title` is observable, and has get/set accessors.
*
* @constructor
* @extends {module:ol/layer/Layer~Layer}
* @extends {module:ol/layer/Layer}
* @fires module:ol/render/Event~RenderEvent
* @param {module:ol/layer/Image~Options=} opt_options Layer options.
* @api
@@ -57,9 +57,9 @@ inherits(ImageLayer, Layer);
/**
* Return the associated {@link module:ol/source/Image~ImageSource source} of the image layer.
* Return the associated {@link module:ol/source/Image source} of the image layer.
* @function
* @return {module:ol/source/Image~ImageSource} Source.
* @return {module:ol/source/Image} Source.
* @api
*/
ImageLayer.prototype.getSource;
+9 -7
View File
@@ -24,7 +24,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] Source for this layer. If not provided to the constructor,
* @property {module: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.
*/
@@ -32,7 +32,7 @@ import SourceState from '../source/State.js';
/**
* @typedef {Object} State
* @property {module:ol/layer/Layer~Layer} layer
* @property {module:ol/layer/Layer} layer
* @property {number} opacity
* @property {module:ol/source/Source~State} sourceState
* @property {boolean} visible
@@ -61,7 +61,7 @@ import SourceState from '../source/State.js';
*
* @constructor
* @abstract
* @extends {module:ol/layer/Base~BaseLayer}
* @extends {module:ol/layer/Base}
* @fires module:ol/render/Event~RenderEvent
* @param {module:ol/layer/Layer~Options} options Layer options.
* @api
@@ -142,13 +142,15 @@ Layer.prototype.getLayerStatesArray = function(opt_states) {
/**
* Get the layer source.
* @return {module:ol/source/Source~Source} The layer source (or `null` if not yet set).
* @return {module:ol/source/Source} The layer source (or `null` if not yet set).
* @observable
* @api
*/
Layer.prototype.getSource = function() {
const source = this.get(LayerProperty.SOURCE);
return /** @type {module:ol/source/Source~Source} */ (source) || null;
return (
/** @type {module:ol/source/Source} */ (source) || null
);
};
@@ -195,7 +197,7 @@ Layer.prototype.handleSourcePropertyChange_ = function() {
*
* To add the layer to a map and have it managed by the map, use
* {@link ol.Map#addLayer} instead.
* @param {module:ol/PluggableMap~PluggableMap} map Map.
* @param {module:ol/PluggableMap} map Map.
* @api
*/
Layer.prototype.setMap = function(map) {
@@ -226,7 +228,7 @@ Layer.prototype.setMap = function(map) {
/**
* Set the layer source.
* @param {module:ol/source/Source~Source} source The layer source.
* @param {module:ol/source/Source} source The layer source.
* @observable
* @api
*/
+4 -4
View File
@@ -22,8 +22,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~TileSource} [source] Source for this layer.
* @property {module:ol/PluggableMap~PluggableMap} [map] Sets the layer as overlay on a map. The map will not manage
* @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
* 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 ol.Map#addLayer}.
@@ -40,7 +40,7 @@ import {assign} from '../obj.js';
* options means that `title` is observable, and has get/set accessors.
*
* @constructor
* @extends {module:ol/layer/Layer~Layer}
* @extends {module:ol/layer/Layer}
* @fires module:ol/render/Event~RenderEvent
* @param {module:ol/layer/Tile~Options=} opt_options Tile layer options.
* @api
@@ -84,7 +84,7 @@ TileLayer.prototype.getPreload = function() {
/**
* Return the associated {@link ol.source.Tile tilesource} of the layer.
* @function
* @return {module:ol/source/Tile~TileSource} Source.
* @return {module:ol/source/Tile} Source.
* @api
*/
TileLayer.prototype.getSource;
+13 -11
View File
@@ -32,15 +32,15 @@ import {createDefaultStyle, toFunction as toStyleFunction} from '../style/Style.
* 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~VectorSource} [source] Source.
* @property {module:ol/PluggableMap~PluggableMap} [map] Sets the layer as overlay on a map. The map will not manage
* @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
* 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 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~Style|Array.<module:ol/style/Style~Style>|module:ol/style~StyleFunction} [style] Layer style. See
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style~StyleFunction} [style] Layer style. See
* {@link ol.style} for default style which will be used if this is not defined.
* @property {number} [maxTilesLoading=16] Maximum number tiles to load simultaneously.
* @property {boolean} [updateWhileAnimating=false] When set to `true`, feature batches will be
@@ -85,7 +85,7 @@ const Property = {
* options means that `title` is observable, and has get/set accessors.
*
* @constructor
* @extends {module:ol/layer/Layer~Layer}
* @extends {module:ol/layer/Layer}
* @fires module:ol/render/Event~RenderEvent
* @param {module:ol/layer/Vector~Options=} opt_options Options.
* @api
@@ -117,7 +117,7 @@ const VectorLayer = function(opt_options) {
/**
* User provided style.
* @type {module:ol/style/Style~Style|Array.<module:ol/style/Style~Style>|module:ol/style~StyleFunction}
* @type {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style~StyleFunction}
* @private
*/
this.style_ = null;
@@ -188,18 +188,20 @@ VectorLayer.prototype.getRenderBuffer = function() {
/**
* @return {function(module:ol/Feature~Feature, module:ol/Feature~Feature): number|null|undefined} Render
* @return {function(module:ol/Feature, module:ol/Feature): number|null|undefined} Render
* order.
*/
VectorLayer.prototype.getRenderOrder = function() {
return /** @type {module:ol/render~OrderFunction|null|undefined} */ (this.get(Property.RENDER_ORDER));
return (
/** @type {module:ol/render~OrderFunction|null|undefined} */ (this.get(Property.RENDER_ORDER))
);
};
/**
* Return the associated {@link module:ol/source/Vector~VectorSource vectorsource} of the layer.
* Return the associated {@link module:ol/source/Vector vectorsource} of the layer.
* @function
* @return {module:ol/source/Vector~VectorSource} Source.
* @return {module:ol/source/Vector} Source.
* @api
*/
VectorLayer.prototype.getSource;
@@ -208,7 +210,7 @@ VectorLayer.prototype.getSource;
/**
* 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~Style|Array.<module:ol/style/Style~Style>|module:ol/style~StyleFunction}
* @return {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style~StyleFunction}
* Layer style.
* @api
*/
@@ -261,7 +263,7 @@ VectorLayer.prototype.setRenderOrder = function(renderOrder) {
* 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 ol.style} for information on the default style.
* @param {module:ol/style/Style~Style|Array.<module:ol/style/Style~Style>|module:ol/style~StyleFunction|null|undefined}
* @param {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style~StyleFunction|null|undefined}
* style Layer style.
* @api
*/
+7 -7
View File
@@ -60,8 +60,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~VectorTile} [source] Source.
* @property {module:ol/PluggableMap~PluggableMap} [map] Sets the layer as overlay on a map. The map will not manage
* @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
* 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 ol.Map#addLayer}.
@@ -69,7 +69,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~Style|Array.<module:ol/style/Style~Style>|module:ol/style~StyleFunction} [style] Layer style. See
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style~StyleFunction} [style] Layer style. See
* {@link ol.style} for default style which will be used if this is not defined.
* @property {number} [maxTilesLoading=16] Maximum number tiles to load simultaneously.
* @property {boolean} [updateWhileAnimating=false] When set to `true`, feature batches will be
@@ -82,7 +82,7 @@ export const RenderType = {
* means no preloading.
* @property {module:ol/render~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~Style|Array.<module:ol/style/Style~Style>|module:ol/style~StyleFunction)} [style] Layer style. See
* @property {(module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style~StyleFunction)} [style] Layer style. See
* {@link ol.style} for default style which will be used if this is not defined.
* @property {boolean} [useInterimTilesOnError=true] Use interim tiles on error.
*/
@@ -96,7 +96,7 @@ export const RenderType = {
* options means that `title` is observable, and has get/set accessors.
*
* @constructor
* @extends {module:ol/layer/Vector~VectorLayer}
* @extends {module:ol/layer/Vector}
* @param {module:ol/layer/VectorTile~Options=} opt_options Options.
* @api
*/
@@ -181,9 +181,9 @@ VectorTileLayer.prototype.setUseInterimTilesOnError = function(useInterimTilesOn
/**
* Return the associated {@link module:ol/source/VectorTile~VectorTile vectortilesource} of the layer.
* Return the associated {@link module:ol/source/VectorTile vectortilesource} of the layer.
* @function
* @return {module:ol/source/VectorTile~VectorTile} Source.
* @return {module:ol/source/VectorTile} Source.
* @api
*/
VectorTileLayer.prototype.getSource;