From 3dbabb734bfcd3068c232358acd619bf0558e54e Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Wed, 4 Apr 2018 12:03:33 +0200 Subject: [PATCH] Module type for ol.source.Vector --- src/ol/interaction/DragAndDrop.js | 4 ++-- src/ol/layer/Heatmap.js | 2 +- src/ol/layer/Vector.js | 6 +++--- src/ol/renderer/canvas/VectorLayer.js | 2 +- src/ol/source/Cluster.js | 8 ++++---- src/ol/source/Vector.js | 24 ++++++++++++------------ src/ol/source/VectorTile.js | 2 +- 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/ol/interaction/DragAndDrop.js b/src/ol/interaction/DragAndDrop.js index e5b42c77b1..45b0e36661 100644 --- a/src/ol/interaction/DragAndDrop.js +++ b/src/ol/interaction/DragAndDrop.js @@ -15,7 +15,7 @@ import {get as getProjection} from '../proj.js'; /** * @typedef {Object} Options * @property {Array.} [formatConstructors] Format constructors. - * @property {ol.source.Vector} [source] Optional vector source where features will be added. If a source is provided + * @property {module:ol/source/Vector~VectorSource} [source] Optional vector source where features will be added. If a source is provided * all existing features will be removed and new features will be added when * they are dropped on the target. If you want to add features to a vector * source without removing the existing features (append only), instead of @@ -120,7 +120,7 @@ const DragAndDrop = function(opt_options) { /** * @private - * @type {ol.source.Vector} + * @type {module:ol/source/Vector~VectorSource} */ this.source_ = options.source || null; diff --git a/src/ol/layer/Heatmap.js b/src/ol/layer/Heatmap.js index 205b5378ff..1dc5e1da22 100644 --- a/src/ol/layer/Heatmap.js +++ b/src/ol/layer/Heatmap.js @@ -33,7 +33,7 @@ import Style from '../style/Style.js'; * @property {string|function(module:ol/Feature~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 {ol.source.Vector} [source] Source. + * @property {module:ol/source/Vector~VectorSource} [source] Source. */ diff --git a/src/ol/layer/Vector.js b/src/ol/layer/Vector.js index f19efb66c8..51538a72e3 100644 --- a/src/ol/layer/Vector.js +++ b/src/ol/layer/Vector.js @@ -32,7 +32,7 @@ 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 {ol.source.Vector} [source] Source. + * @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 * 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 @@ -181,9 +181,9 @@ VectorLayer.prototype.getRenderOrder = function() { /** - * Return the associated {@link ol.source.Vector vectorsource} of the layer. + * Return the associated {@link module:ol/source/Vector~VectorSource vectorsource} of the layer. * @function - * @return {ol.source.Vector} Source. + * @return {module:ol/source/Vector~VectorSource} Source. * @api */ VectorLayer.prototype.getSource; diff --git a/src/ol/renderer/canvas/VectorLayer.js b/src/ol/renderer/canvas/VectorLayer.js index 256b28eaac..06a33c57a3 100644 --- a/src/ol/renderer/canvas/VectorLayer.js +++ b/src/ol/renderer/canvas/VectorLayer.js @@ -130,7 +130,7 @@ CanvasVectorLayerRenderer.prototype.composeFrame = function(frameState, layerSta const projection = viewState.projection; const rotation = viewState.rotation; const projectionExtent = projection.getExtent(); - const vectorSource = /** @type {ol.source.Vector} */ (this.getLayer().getSource()); + const vectorSource = /** @type {module:ol/source/Vector~VectorSource} */ (this.getLayer().getSource()); let transform = this.getTransform(frameState, 0); diff --git a/src/ol/source/Cluster.js b/src/ol/source/Cluster.js index c346155a2e..7b1f8b7e06 100644 --- a/src/ol/source/Cluster.js +++ b/src/ol/source/Cluster.js @@ -32,7 +32,7 @@ import VectorSource from '../source/Vector.js'; * See {@link module:ol/geom/Polygon~Polygon#getInteriorPoint} for a way to get a cluster * calculation point for polygons. * @property {module:ol/proj~ProjectionLike} projection Projection. - * @property {ol.source.Vector} source Source. + * @property {module:ol/source/Vector~VectorSource} source Source. * @property {boolean} [wrapX=true] Whether to wrap the world horizontally. */ @@ -45,7 +45,7 @@ import VectorSource from '../source/Vector.js'; * * @constructor * @param {module:ol/source/Cluster~Options=} options Cluster options. - * @extends {ol.source.Vector} + * @extends {module:ol/source/Vector~VectorSource} * @api */ const Cluster = function(options) { @@ -87,7 +87,7 @@ const Cluster = function(options) { }; /** - * @type {ol.source.Vector} + * @type {module:ol/source/Vector~VectorSource} * @protected */ this.source = options.source; @@ -110,7 +110,7 @@ Cluster.prototype.getDistance = function() { /** * Get a reference to the wrapped source. - * @return {ol.source.Vector} Source. + * @return {module:ol/source/Vector~VectorSource} Source. * @api */ Cluster.prototype.getSource = function() { diff --git a/src/ol/source/Vector.js b/src/ol/source/Vector.js index 8f16bf4cba..c8c12f97f8 100644 --- a/src/ol/source/Vector.js +++ b/src/ol/source/Vector.js @@ -24,7 +24,7 @@ import RBush from '../structs/RBush.js'; /** * @classdesc - * Events emitted by {@link ol.source.Vector} instances are instances of this + * Events emitted by {@link module:ol/source/Vector~VectorSource} instances are instances of this * type. * * @constructor @@ -64,7 +64,7 @@ inherits(VectorSourceEvent, Event); * Example: * * ```js - * var vectorSource = new ol.source.Vector({ + * var vectorSource = new module:ol/source/Vector~VectorSource({ * format: new ol.format.GeoJSON(), * loader: function(extent, resolution, projection) { * var proj = projection.getCode(); @@ -119,15 +119,15 @@ inherits(VectorSourceEvent, Event); * `false` may improve performance. * * Note that - * {@link ol.source.Vector#getFeaturesInExtent}, - * {@link ol.source.Vector#getClosestFeatureToCoordinate} and - * {@link ol.source.Vector#getExtent} cannot be used when `useSpatialIndex` is - * set to `false`, and {@link ol.source.Vector#forEachFeatureInExtent} will loop + * {@link module:ol/source/Vector~VectorSource#getFeaturesInExtent}, + * {@link module:ol/source/Vector~VectorSource#getClosestFeatureToCoordinate} and + * {@link module:ol/source/Vector~VectorSource#getExtent} cannot be used when `useSpatialIndex` is + * set to `false`, and {@link module:ol/source/Vector~VectorSource#forEachFeatureInExtent} will loop * through all features. * * When set to `false`, the features will be maintained in an * {@link ol.Collection}, which can be retrieved through - * {@link ol.source.Vector#getFeaturesCollection}. + * {@link module:ol/source/Vector~VectorSource#getFeaturesCollection}. * @property {boolean} [wrapX=true] Wrap the world horizontally. For vector editing across the * -180° and 180° meridians to work properly, this should be set to `false`. The * resulting geometry coordinates will then exceed the world bounds. @@ -266,7 +266,7 @@ inherits(VectorSource, Source); /** * Add a single feature to the source. If you want to add a batch of features - * at once, call {@link ol.source.Vector#addFeatures source.addFeatures()} + * at once, call {@link module:ol/source/Vector~VectorSource#addFeatures source.addFeatures()} * instead. A feature will not be added to the source if feature with * the same id is already there. The reason for this behavior is to avoid * feature duplication when using bbox or tile loading strategies. @@ -535,11 +535,11 @@ VectorSource.prototype.forEachFeatureAtCoordinateDirect = function(coordinate, c * value, iteration will stop and the function will return the same value. * * If you are interested in features whose geometry intersects an extent, call - * the {@link ol.source.Vector#forEachFeatureIntersectingExtent + * the {@link module:ol/source/Vector~VectorSource#forEachFeatureIntersectingExtent * source.forEachFeatureIntersectingExtent()} method instead. * * When `useSpatialIndex` is set to false, this method will loop through all - * features, equivalent to {@link ol.source.Vector#forEachFeature}. + * features, equivalent to {@link module:ol/source/Vector~VectorSource#forEachFeature}. * * @param {module:ol/extent~Extent} extent Extent. * @param {function(module:ol/Feature~Feature): T} callback Called with each feature @@ -563,7 +563,7 @@ VectorSource.prototype.forEachFeatureInExtent = function(extent, callback) { * value, iteration will stop and the function will return the same value. * * If you only want to test for bounding box intersection, call the - * {@link ol.source.Vector#forEachFeatureInExtent + * {@link module:ol/source/Vector~VectorSource#forEachFeatureInExtent * source.forEachFeatureInExtent()} method instead. * * @param {module:ol/extent~Extent} extent Extent. @@ -883,7 +883,7 @@ VectorSource.prototype.removeLoadedExtent = function(extent) { /** * Remove a single feature from the source. If you want to remove all features - * at once, use the {@link ol.source.Vector#clear source.clear()} method + * at once, use the {@link module:ol/source/Vector~VectorSource#clear source.clear()} method * instead. * @param {module:ol/Feature~Feature} feature Feature to remove. * @api diff --git a/src/ol/source/VectorTile.js b/src/ol/source/VectorTile.js index 99101a0d60..cd68b572f0 100644 --- a/src/ol/source/VectorTile.js +++ b/src/ol/source/VectorTile.js @@ -61,7 +61,7 @@ import {createXYZ, extentFromProjection, createForProjection} from '../tilegrid. * with vector features from the server, it is not meant for feature editing. * Features are optimized for rendering, their geometries are clipped at or near * tile boundaries and simplified for a view resolution. See - * {@link ol.source.Vector} for vector sources that are suitable for feature + * {@link module:ol/source/Vector~VectorSource} for vector sources that are suitable for feature * editing. * * @constructor