Module type for ol/Feature

This commit is contained in:
Tim Schaub
2018-03-11 23:32:28 -06:00
parent 5c9aa0ce93
commit cf80733e41
56 changed files with 333 additions and 333 deletions
+3 -3
View File
@@ -35,7 +35,7 @@ const DragAndDropEventType = {
* @implements {oli.interaction.DragAndDropEvent}
* @param {ol.interaction.DragAndDropEventType} type Type.
* @param {File} file File.
* @param {Array.<ol.Feature>=} opt_features Features.
* @param {Array.<module:ol/Feature~Feature>=} opt_features Features.
* @param {module:ol/proj/Projection~Projection=} opt_projection Projection.
*/
const DragAndDropEvent = function(type, file, opt_features, opt_projection) {
@@ -44,7 +44,7 @@ const DragAndDropEvent = function(type, file, opt_features, opt_projection) {
/**
* The features parsed from dropped data.
* @type {Array.<ol.Feature>|undefined}
* @type {Array.<module:ol/Feature~Feature>|undefined}
* @api
*/
this.features = opt_features;
@@ -238,7 +238,7 @@ DragAndDrop.prototype.setMap = function(map) {
* @param {string} text Text.
* @param {module:ol/format/Feature~ReadOptions} options Read options.
* @private
* @return {Array.<ol.Feature>} Features.
* @return {Array.<module:ol/Feature~Feature>} Features.
*/
DragAndDrop.prototype.tryReadFeatures_ = function(format, text, options) {
try {
+8 -8
View File
@@ -70,7 +70,7 @@ const DrawEventType = {
* @extends {ol.events.Event}
* @implements {oli.DrawEvent}
* @param {ol.interaction.DrawEventType} type Type.
* @param {ol.Feature} feature The feature drawn.
* @param {module:ol/Feature~Feature} feature The feature drawn.
*/
const DrawEvent = function(type, feature) {
@@ -78,7 +78,7 @@ const DrawEvent = function(type, feature) {
/**
* The feature being drawn.
* @type {ol.Feature}
* @type {module:ol/Feature~Feature}
* @api
*/
this.feature = feature;
@@ -145,7 +145,7 @@ const Draw = function(options) {
/**
* Target collection for drawn features.
* @type {ol.Collection.<ol.Feature>}
* @type {ol.Collection.<module:ol/Feature~Feature>}
* @private
*/
this.features_ = options.features ? options.features : null;
@@ -281,14 +281,14 @@ const Draw = function(options) {
/**
* Sketch feature.
* @type {ol.Feature}
* @type {module:ol/Feature~Feature}
* @private
*/
this.sketchFeature_ = null;
/**
* Sketch point.
* @type {ol.Feature}
* @type {module:ol/Feature~Feature}
* @private
*/
this.sketchPoint_ = null;
@@ -302,7 +302,7 @@ const Draw = function(options) {
/**
* Sketch line. Used when drawing polygon.
* @type {ol.Feature}
* @type {module:ol/Feature~Feature}
* @private
*/
this.sketchLine_ = null;
@@ -810,7 +810,7 @@ Draw.prototype.finishDrawing = function() {
/**
* Stop drawing without adding the sketch feature to the target layer.
* @return {ol.Feature} The sketch feature (or null if none).
* @return {module:ol/Feature~Feature} The sketch feature (or null if none).
* @private
*/
Draw.prototype.abortDrawing_ = function() {
@@ -830,7 +830,7 @@ Draw.prototype.abortDrawing_ = function() {
* Extend an existing geometry by adding additional points. This only works
* on features with `LineString` geometries, where the interaction will
* extend lines by adding points to the end of the coordinates array.
* @param {!ol.Feature} feature Feature to be extended.
* @param {!module:ol/Feature~Feature} feature Feature to be extended.
* @api
*/
Draw.prototype.extend = function(feature) {
+4 -4
View File
@@ -89,14 +89,14 @@ const ExtentInteraction = function(opt_options) {
/**
* Feature for displaying the visible extent
* @type {ol.Feature}
* @type {module:ol/Feature~Feature}
* @private
*/
this.extentFeature_ = null;
/**
* Feature for displaying the visible pointer
* @type {ol.Feature}
* @type {module:ol/Feature~Feature}
* @private
*/
this.vertexFeature_ = null;
@@ -382,7 +382,7 @@ ExtentInteraction.prototype.handlePointerMove_ = function(mapBrowserEvent) {
/**
* @param {module:ol/extent~Extent} extent extent
* @returns {ol.Feature} extent as featrue
* @returns {module:ol/Feature~Feature} extent as featrue
* @private
*/
ExtentInteraction.prototype.createOrUpdateExtentFeature_ = function(extent) {
@@ -409,7 +409,7 @@ ExtentInteraction.prototype.createOrUpdateExtentFeature_ = function(extent) {
/**
* @param {module:ol/coordinate~Coordinate} vertex location of feature
* @returns {ol.Feature} vertex as feature
* @returns {module:ol/Feature~Feature} vertex as feature
* @private
*/
ExtentInteraction.prototype.createOrUpdatePointerFeature_ = function(vertex) {
+20 -20
View File
@@ -52,7 +52,7 @@ const ModifyEventType = {
* @extends {ol.events.Event}
* @implements {oli.ModifyEvent}
* @param {ModifyEventType} type Type.
* @param {ol.Collection.<ol.Feature>} features The features modified.
* @param {ol.Collection.<module:ol/Feature~Feature>} features The features modified.
* @param {ol.MapBrowserPointerEvent} mapBrowserPointerEvent Associated
* {@link ol.MapBrowserPointerEvent}.
*/
@@ -62,7 +62,7 @@ export const ModifyEvent = function(type, features, mapBrowserPointerEvent) {
/**
* The features being modified.
* @type {ol.Collection.<ol.Feature>}
* @type {ol.Collection.<module:ol/Feature~Feature>}
* @api
*/
this.features = features;
@@ -138,7 +138,7 @@ const Modify = function(options) {
/**
* Editing vertex.
* @type {ol.Feature}
* @type {module:ol/Feature~Feature}
* @private
*/
this.vertexFeature_ = null;
@@ -223,7 +223,7 @@ const Modify = function(options) {
/**
* @const
* @private
* @type {!Object.<string, function(ol.Feature, module:ol/geom/Geometry~Geometry)>}
* @type {!Object.<string, function(module:ol/Feature~Feature, module:ol/geom/Geometry~Geometry)>}
*/
this.SEGMENT_WRITERS_ = {
'Point': this.writePointGeometry_,
@@ -260,7 +260,7 @@ const Modify = function(options) {
}
/**
* @type {ol.Collection.<ol.Feature>}
* @type {ol.Collection.<module:ol/Feature~Feature>}
* @private
*/
this.features_ = features;
@@ -298,7 +298,7 @@ const CIRCLE_CIRCUMFERENCE_INDEX = 1;
/**
* @param {ol.Feature} feature Feature.
* @param {module:ol/Feature~Feature} feature Feature.
* @private
*/
Modify.prototype.addFeature_ = function(feature) {
@@ -329,7 +329,7 @@ Modify.prototype.willModifyFeatures_ = function(evt) {
/**
* @param {ol.Feature} feature Feature.
* @param {module:ol/Feature~Feature} feature Feature.
* @private
*/
Modify.prototype.removeFeature_ = function(feature) {
@@ -346,7 +346,7 @@ Modify.prototype.removeFeature_ = function(feature) {
/**
* @param {ol.Feature} feature Feature.
* @param {module:ol/Feature~Feature} feature Feature.
* @private
*/
Modify.prototype.removeFeatureSegmentData_ = function(feature) {
@@ -415,7 +415,7 @@ Modify.prototype.handleSourceRemove_ = function(event) {
* @private
*/
Modify.prototype.handleFeatureAdd_ = function(evt) {
this.addFeature_(/** @type {ol.Feature} */ (evt.element));
this.addFeature_(/** @type {module:ol/Feature~Feature} */ (evt.element));
};
@@ -425,7 +425,7 @@ Modify.prototype.handleFeatureAdd_ = function(evt) {
*/
Modify.prototype.handleFeatureChange_ = function(evt) {
if (!this.changingFeature_) {
const feature = /** @type {ol.Feature} */ (evt.target);
const feature = /** @type {module:ol/Feature~Feature} */ (evt.target);
this.removeFeature_(feature);
this.addFeature_(feature);
}
@@ -437,13 +437,13 @@ Modify.prototype.handleFeatureChange_ = function(evt) {
* @private
*/
Modify.prototype.handleFeatureRemove_ = function(evt) {
const feature = /** @type {ol.Feature} */ (evt.element);
const feature = /** @type {module:ol/Feature~Feature} */ (evt.element);
this.removeFeature_(feature);
};
/**
* @param {ol.Feature} feature Feature
* @param {module:ol/Feature~Feature} feature Feature
* @param {module:ol/geom/Point~Point} geometry Geometry.
* @private
*/
@@ -459,7 +459,7 @@ Modify.prototype.writePointGeometry_ = function(feature, geometry) {
/**
* @param {ol.Feature} feature Feature
* @param {module:ol/Feature~Feature} feature Feature
* @param {module:ol/geom/MultiPoint~MultiPoint} geometry Geometry.
* @private
*/
@@ -480,7 +480,7 @@ Modify.prototype.writeMultiPointGeometry_ = function(feature, geometry) {
/**
* @param {ol.Feature} feature Feature
* @param {module:ol/Feature~Feature} feature Feature
* @param {module:ol/geom/LineString~LineString} geometry Geometry.
* @private
*/
@@ -500,7 +500,7 @@ Modify.prototype.writeLineStringGeometry_ = function(feature, geometry) {
/**
* @param {ol.Feature} feature Feature
* @param {module:ol/Feature~Feature} feature Feature
* @param {module:ol/geom/MultiLineString~MultiLineString} geometry Geometry.
* @private
*/
@@ -524,7 +524,7 @@ Modify.prototype.writeMultiLineStringGeometry_ = function(feature, geometry) {
/**
* @param {ol.Feature} feature Feature
* @param {module:ol/Feature~Feature} feature Feature
* @param {module:ol/geom/Polygon~Polygon} geometry Geometry.
* @private
*/
@@ -548,7 +548,7 @@ Modify.prototype.writePolygonGeometry_ = function(feature, geometry) {
/**
* @param {ol.Feature} feature Feature
* @param {module:ol/Feature~Feature} feature Feature
* @param {module:ol/geom/MultiPolygon~MultiPolygon} geometry Geometry.
* @private
*/
@@ -581,7 +581,7 @@ Modify.prototype.writeMultiPolygonGeometry_ = function(feature, geometry) {
* {@link CIRCLE_CIRCUMFERENCE_INDEX} is
* the circumference, and is not a line segment.
*
* @param {ol.Feature} feature Feature.
* @param {module:ol/Feature~Feature} feature Feature.
* @param {module:ol/geom/Circle~Circle} geometry Geometry.
* @private
*/
@@ -607,7 +607,7 @@ Modify.prototype.writeCircleGeometry_ = function(feature, geometry) {
/**
* @param {ol.Feature} feature Feature
* @param {module:ol/Feature~Feature} feature Feature
* @param {module:ol/geom/GeometryCollection~GeometryCollection} geometry Geometry.
* @private
*/
@@ -621,7 +621,7 @@ Modify.prototype.writeGeometryCollectionGeometry_ = function(feature, geometry)
/**
* @param {module:ol/coordinate~Coordinate} coordinates Coordinates.
* @return {ol.Feature} Vertex feature.
* @return {module:ol/Feature~Feature} Vertex feature.
* @private
*/
Modify.prototype.createOrUpdateVertexFeature_ = function(coordinates) {
+12 -12
View File
@@ -35,8 +35,8 @@ const SelectEventType = {
* this type.
*
* @param {SelectEventType} type The event type.
* @param {Array.<ol.Feature>} selected Selected features.
* @param {Array.<ol.Feature>} deselected Deselected features.
* @param {Array.<module:ol/Feature~Feature>} selected Selected features.
* @param {Array.<module:ol/Feature~Feature>} deselected Deselected features.
* @param {ol.MapBrowserEvent} mapBrowserEvent Associated
* {@link ol.MapBrowserEvent}.
* @implements {oli.SelectEvent}
@@ -48,14 +48,14 @@ const SelectEvent = function(type, selected, deselected, mapBrowserEvent) {
/**
* Selected features array.
* @type {Array.<ol.Feature>}
* @type {Array.<module:ol/Feature~Feature>}
* @api
*/
this.selected = selected;
/**
* Deselected features array.
* @type {Array.<ol.Feature>}
* @type {Array.<module:ol/Feature~Feature>}
* @api
*/
this.deselected = deselected;
@@ -198,7 +198,7 @@ inherits(Select, Interaction);
/**
* @param {ol.Feature|ol.render.Feature} feature Feature.
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature.
* @param {ol.layer.Layer} layer Layer.
* @private
*/
@@ -210,7 +210,7 @@ Select.prototype.addFeatureLayerAssociation_ = function(feature, layer) {
/**
* Get the selected features.
* @return {ol.Collection.<ol.Feature>} Features collection.
* @return {ol.Collection.<module:ol/Feature~Feature>} Features collection.
* @api
*/
Select.prototype.getFeatures = function() {
@@ -233,7 +233,7 @@ Select.prototype.getHitTolerance = function() {
* the (last) selected feature. Note that this will not work with any
* programmatic method like pushing features to
* {@link ol.interaction.Select#getFeatures collection}.
* @param {ol.Feature|ol.render.Feature} feature Feature
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature
* @return {ol.layer.Vector} Layer.
* @api
*/
@@ -270,7 +270,7 @@ function handleEvent(mapBrowserEvent) {
map.forEachFeatureAtPixel(mapBrowserEvent.pixel,
(
/**
* @param {ol.Feature|ol.render.Feature} feature Feature.
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature.
* @param {ol.layer.Layer} layer Layer.
* @return {boolean|undefined} Continue to iterate over the features.
*/
@@ -303,7 +303,7 @@ function handleEvent(mapBrowserEvent) {
map.forEachFeatureAtPixel(mapBrowserEvent.pixel,
(
/**
* @param {ol.Feature|ol.render.Feature} feature Feature.
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature.
* @param {ol.layer.Layer} layer Layer.
* @return {boolean|undefined} Continue to iterate over the features.
*/
@@ -394,7 +394,7 @@ function getDefaultStyleFunction() {
Select.prototype.addFeature_ = function(evt) {
const map = this.getMap();
if (map) {
map.skipFeature(/** @type {ol.Feature} */ (evt.element));
map.skipFeature(/** @type {module:ol/Feature~Feature} */ (evt.element));
}
};
@@ -406,13 +406,13 @@ Select.prototype.addFeature_ = function(evt) {
Select.prototype.removeFeature_ = function(evt) {
const map = this.getMap();
if (map) {
map.unskipFeature(/** @type {ol.Feature} */ (evt.element));
map.unskipFeature(/** @type {module:ol/Feature~Feature} */ (evt.element));
}
};
/**
* @param {ol.Feature|ol.render.Feature} feature Feature.
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature.
* @private
*/
Select.prototype.removeFeatureLayerAssociation_ = function(feature) {
+21 -21
View File
@@ -68,7 +68,7 @@ const Snap = function(opt_options) {
this.edge_ = options.edge !== undefined ? options.edge : true;
/**
* @type {ol.Collection.<ol.Feature>}
* @type {ol.Collection.<module:ol/Feature~Feature>}
* @private
*/
this.features_ = options.features ? options.features : null;
@@ -97,7 +97,7 @@ const Snap = function(opt_options) {
* If a feature geometry changes while a pointer drag|move event occurs, the
* feature doesn't get updated right away. It will be at the next 'pointerup'
* event fired.
* @type {!Object.<number, ol.Feature>}
* @type {!Object.<number, module:ol/Feature~Feature>}
* @private
*/
this.pendingFeatures_ = {};
@@ -134,7 +134,7 @@ const Snap = function(opt_options) {
/**
* @const
* @private
* @type {Object.<string, function(ol.Feature, module:ol/geom/Geometry~Geometry)>}
* @type {Object.<string, function(module:ol/Feature~Feature, module:ol/geom/Geometry~Geometry)>}
*/
this.SEGMENT_WRITERS_ = {
'Point': this.writePointGeometry_,
@@ -154,7 +154,7 @@ inherits(Snap, PointerInteraction);
/**
* Add a feature to the collection of features that we may snap to.
* @param {ol.Feature} feature Feature.
* @param {module:ol/Feature~Feature} feature Feature.
* @param {boolean=} opt_listen Whether to listen to the feature change or not
* Defaults to `true`.
* @api
@@ -181,7 +181,7 @@ Snap.prototype.addFeature = function(feature, opt_listen) {
/**
* @param {ol.Feature} feature Feature.
* @param {module:ol/Feature~Feature} feature Feature.
* @private
*/
Snap.prototype.forEachFeatureAdd_ = function(feature) {
@@ -190,7 +190,7 @@ Snap.prototype.forEachFeatureAdd_ = function(feature) {
/**
* @param {ol.Feature} feature Feature.
* @param {module:ol/Feature~Feature} feature Feature.
* @private
*/
Snap.prototype.forEachFeatureRemove_ = function(feature) {
@@ -199,7 +199,7 @@ Snap.prototype.forEachFeatureRemove_ = function(feature) {
/**
* @return {ol.Collection.<ol.Feature>|Array.<ol.Feature>} Features.
* @return {ol.Collection.<module:ol/Feature~Feature>|Array.<module:ol/Feature~Feature>} Features.
* @private
*/
Snap.prototype.getFeatures_ = function() {
@@ -209,7 +209,7 @@ Snap.prototype.getFeatures_ = function() {
} else if (this.source_) {
features = this.source_.getFeatures();
}
return /** @type {!Array.<ol.Feature>|!ol.Collection.<ol.Feature>} */ (features);
return /** @type {!Array.<module:ol/Feature~Feature>|!ol.Collection.<module:ol/Feature~Feature>} */ (features);
};
@@ -224,7 +224,7 @@ Snap.prototype.handleFeatureAdd_ = function(evt) {
} else if (evt instanceof CollectionEvent) {
feature = evt.element;
}
this.addFeature(/** @type {ol.Feature} */ (feature));
this.addFeature(/** @type {module:ol/Feature~Feature} */ (feature));
};
@@ -239,7 +239,7 @@ Snap.prototype.handleFeatureRemove_ = function(evt) {
} else if (evt instanceof CollectionEvent) {
feature = evt.element;
}
this.removeFeature(/** @type {ol.Feature} */ (feature));
this.removeFeature(/** @type {module:ol/Feature~Feature} */ (feature));
};
@@ -248,7 +248,7 @@ Snap.prototype.handleFeatureRemove_ = function(evt) {
* @private
*/
Snap.prototype.handleFeatureChange_ = function(evt) {
const feature = /** @type {ol.Feature} */ (evt.target);
const feature = /** @type {module:ol/Feature~Feature} */ (evt.target);
if (this.handlingDownUpSequence) {
const uid = getUid(feature);
if (!(uid in this.pendingFeatures_)) {
@@ -262,7 +262,7 @@ Snap.prototype.handleFeatureChange_ = function(evt) {
/**
* Remove a feature from the collection of features that we may snap to.
* @param {ol.Feature} feature Feature
* @param {module:ol/Feature~Feature} feature Feature
* @param {boolean=} opt_unlisten Whether to unlisten to the feature change
* or not. Defaults to `true`.
* @api
@@ -417,7 +417,7 @@ Snap.prototype.snapTo = function(pixel, pixelCoordinate, map) {
/**
* @param {ol.Feature} feature Feature
* @param {module:ol/Feature~Feature} feature Feature
* @private
*/
Snap.prototype.updateFeature_ = function(feature) {
@@ -427,7 +427,7 @@ Snap.prototype.updateFeature_ = function(feature) {
/**
* @param {ol.Feature} feature Feature
* @param {module:ol/Feature~Feature} feature Feature
* @param {module:ol/geom/Circle~Circle} geometry Geometry.
* @private
*/
@@ -446,7 +446,7 @@ Snap.prototype.writeCircleGeometry_ = function(feature, geometry) {
/**
* @param {ol.Feature} feature Feature
* @param {module:ol/Feature~Feature} feature Feature
* @param {module:ol/geom/GeometryCollection~GeometryCollection} geometry Geometry.
* @private
*/
@@ -462,7 +462,7 @@ Snap.prototype.writeGeometryCollectionGeometry_ = function(feature, geometry) {
/**
* @param {ol.Feature} feature Feature
* @param {module:ol/Feature~Feature} feature Feature
* @param {module:ol/geom/LineString~LineString} geometry Geometry.
* @private
*/
@@ -480,7 +480,7 @@ Snap.prototype.writeLineStringGeometry_ = function(feature, geometry) {
/**
* @param {ol.Feature} feature Feature
* @param {module:ol/Feature~Feature} feature Feature
* @param {module:ol/geom/MultiLineString~MultiLineString} geometry Geometry.
* @private
*/
@@ -501,7 +501,7 @@ Snap.prototype.writeMultiLineStringGeometry_ = function(feature, geometry) {
/**
* @param {ol.Feature} feature Feature
* @param {module:ol/Feature~Feature} feature Feature
* @param {module:ol/geom/MultiPoint~MultiPoint} geometry Geometry.
* @private
*/
@@ -519,7 +519,7 @@ Snap.prototype.writeMultiPointGeometry_ = function(feature, geometry) {
/**
* @param {ol.Feature} feature Feature
* @param {module:ol/Feature~Feature} feature Feature
* @param {module:ol/geom/MultiPolygon~MultiPolygon} geometry Geometry.
* @private
*/
@@ -543,7 +543,7 @@ Snap.prototype.writeMultiPolygonGeometry_ = function(feature, geometry) {
/**
* @param {ol.Feature} feature Feature
* @param {module:ol/Feature~Feature} feature Feature
* @param {module:ol/geom/Point~Point} geometry Geometry.
* @private
*/
@@ -558,7 +558,7 @@ Snap.prototype.writePointGeometry_ = function(feature, geometry) {
/**
* @param {ol.Feature} feature Feature
* @param {module:ol/Feature~Feature} feature Feature
* @param {module:ol/geom/Polygon~Polygon} geometry Geometry.
* @private
*/
+5 -5
View File
@@ -46,7 +46,7 @@ const TranslateEventType = {
* @extends {ol.events.Event}
* @implements {oli.interaction.TranslateEvent}
* @param {ol.interaction.TranslateEventType} type Type.
* @param {ol.Collection.<ol.Feature>} features The features translated.
* @param {ol.Collection.<module:ol/Feature~Feature>} features The features translated.
* @param {module:ol/coordinate~Coordinate} coordinate The event coordinate.
*/
export const TranslateEvent = function(type, features, coordinate) {
@@ -55,7 +55,7 @@ export const TranslateEvent = function(type, features, coordinate) {
/**
* The features being translated.
* @type {ol.Collection.<ol.Feature>}
* @type {ol.Collection.<module:ol/Feature~Feature>}
* @api
*/
this.features = features;
@@ -101,7 +101,7 @@ const Translate = function(opt_options) {
/**
* @type {ol.Collection.<ol.Feature>}
* @type {ol.Collection.<module:ol/Feature~Feature>}
* @private
*/
this.features_ = options.features !== undefined ? options.features : null;
@@ -134,7 +134,7 @@ const Translate = function(opt_options) {
this.hitTolerance_ = options.hitTolerance ? options.hitTolerance : 0;
/**
* @type {ol.Feature}
* @type {module:ol/Feature~Feature}
* @private
*/
this.lastFeature_ = null;
@@ -243,7 +243,7 @@ function handleMoveEvent(event) {
* features.
* @param {module:ol~Pixel} pixel Pixel coordinate to test for intersection.
* @param {ol.PluggableMap} map Map to test the intersection on.
* @return {ol.Feature} Returns the feature found at the specified pixel
* @return {module:ol/Feature~Feature} Returns the feature found at the specified pixel
* coordinates.
* @private
*/