Module type for ol.source.Vector

This commit is contained in:
Frederic Junod
2018-04-04 12:03:33 +02:00
parent e283193ff4
commit 3dbabb734b
7 changed files with 24 additions and 24 deletions

View File

@@ -15,7 +15,7 @@ import {get as getProjection} from '../proj.js';
/** /**
* @typedef {Object} Options * @typedef {Object} Options
* @property {Array.<function(new: module:ol/format/Feature~FeatureFormat)>} [formatConstructors] Format constructors. * @property {Array.<function(new: module:ol/format/Feature~FeatureFormat)>} [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 * 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 * 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 * source without removing the existing features (append only), instead of
@@ -120,7 +120,7 @@ const DragAndDrop = function(opt_options) {
/** /**
* @private * @private
* @type {ol.source.Vector} * @type {module:ol/source/Vector~VectorSource}
*/ */
this.source_ = options.source || null; this.source_ = options.source || null;

View File

@@ -33,7 +33,7 @@ import Style from '../style/Style.js';
* @property {string|function(module:ol/Feature~Feature):number} [weight='weight'] The feature * @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 * 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). * 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.
*/ */

View File

@@ -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. * 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 * * `'vector'`: Vector layers are rendered as vectors. Most accurate rendering even during
* animations, but slower performance. * 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 * @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 * 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 * 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 * @function
* @return {ol.source.Vector} Source. * @return {module:ol/source/Vector~VectorSource} Source.
* @api * @api
*/ */
VectorLayer.prototype.getSource; VectorLayer.prototype.getSource;

View File

@@ -130,7 +130,7 @@ CanvasVectorLayerRenderer.prototype.composeFrame = function(frameState, layerSta
const projection = viewState.projection; const projection = viewState.projection;
const rotation = viewState.rotation; const rotation = viewState.rotation;
const projectionExtent = projection.getExtent(); 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); let transform = this.getTransform(frameState, 0);

View File

@@ -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 * See {@link module:ol/geom/Polygon~Polygon#getInteriorPoint} for a way to get a cluster
* calculation point for polygons. * calculation point for polygons.
* @property {module:ol/proj~ProjectionLike} projection Projection. * @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. * @property {boolean} [wrapX=true] Whether to wrap the world horizontally.
*/ */
@@ -45,7 +45,7 @@ import VectorSource from '../source/Vector.js';
* *
* @constructor * @constructor
* @param {module:ol/source/Cluster~Options=} options Cluster options. * @param {module:ol/source/Cluster~Options=} options Cluster options.
* @extends {ol.source.Vector} * @extends {module:ol/source/Vector~VectorSource}
* @api * @api
*/ */
const Cluster = function(options) { const Cluster = function(options) {
@@ -87,7 +87,7 @@ const Cluster = function(options) {
}; };
/** /**
* @type {ol.source.Vector} * @type {module:ol/source/Vector~VectorSource}
* @protected * @protected
*/ */
this.source = options.source; this.source = options.source;
@@ -110,7 +110,7 @@ Cluster.prototype.getDistance = function() {
/** /**
* Get a reference to the wrapped source. * Get a reference to the wrapped source.
* @return {ol.source.Vector} Source. * @return {module:ol/source/Vector~VectorSource} Source.
* @api * @api
*/ */
Cluster.prototype.getSource = function() { Cluster.prototype.getSource = function() {

View File

@@ -24,7 +24,7 @@ import RBush from '../structs/RBush.js';
/** /**
* @classdesc * @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. * type.
* *
* @constructor * @constructor
@@ -64,7 +64,7 @@ inherits(VectorSourceEvent, Event);
* Example: * Example:
* *
* ```js * ```js
* var vectorSource = new ol.source.Vector({ * var vectorSource = new module:ol/source/Vector~VectorSource({
* format: new ol.format.GeoJSON(), * format: new ol.format.GeoJSON(),
* loader: function(extent, resolution, projection) { * loader: function(extent, resolution, projection) {
* var proj = projection.getCode(); * var proj = projection.getCode();
@@ -119,15 +119,15 @@ inherits(VectorSourceEvent, Event);
* `false` may improve performance. * `false` may improve performance.
* *
* Note that * Note that
* {@link ol.source.Vector#getFeaturesInExtent}, * {@link module:ol/source/Vector~VectorSource#getFeaturesInExtent},
* {@link ol.source.Vector#getClosestFeatureToCoordinate} and * {@link module:ol/source/Vector~VectorSource#getClosestFeatureToCoordinate} and
* {@link ol.source.Vector#getExtent} cannot be used when `useSpatialIndex` is * {@link module:ol/source/Vector~VectorSource#getExtent} cannot be used when `useSpatialIndex` is
* set to `false`, and {@link ol.source.Vector#forEachFeatureInExtent} will loop * set to `false`, and {@link module:ol/source/Vector~VectorSource#forEachFeatureInExtent} will loop
* through all features. * through all features.
* *
* When set to `false`, the features will be maintained in an * When set to `false`, the features will be maintained in an
* {@link ol.Collection}, which can be retrieved through * {@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 * @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 * -180° and 180° meridians to work properly, this should be set to `false`. The
* resulting geometry coordinates will then exceed the world bounds. * 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 * 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 * 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 * the same id is already there. The reason for this behavior is to avoid
* feature duplication when using bbox or tile loading strategies. * 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. * value, iteration will stop and the function will return the same value.
* *
* If you are interested in features whose geometry intersects an extent, call * 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. * source.forEachFeatureIntersectingExtent()} method instead.
* *
* When `useSpatialIndex` is set to false, this method will loop through all * 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 {module:ol/extent~Extent} extent Extent.
* @param {function(module:ol/Feature~Feature): T} callback Called with each feature * @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. * value, iteration will stop and the function will return the same value.
* *
* If you only want to test for bounding box intersection, call the * 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. * source.forEachFeatureInExtent()} method instead.
* *
* @param {module:ol/extent~Extent} extent Extent. * @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 * 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. * instead.
* @param {module:ol/Feature~Feature} feature Feature to remove. * @param {module:ol/Feature~Feature} feature Feature to remove.
* @api * @api

View File

@@ -61,7 +61,7 @@ import {createXYZ, extentFromProjection, createForProjection} from '../tilegrid.
* with vector features from the server, it is not meant for feature editing. * 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 * Features are optimized for rendering, their geometries are clipped at or near
* tile boundaries and simplified for a view resolution. See * 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. * editing.
* *
* @constructor * @constructor