Remove extra imports in jsdoc
The symbols are already imported (es6 import)
This commit is contained in:
@@ -30,16 +30,16 @@ import {createEditingStyle} from '../style/Style.js';
|
||||
|
||||
/**
|
||||
* @typedef {Object} Options
|
||||
* @property {import("../geom/GeometryType.js").default} type Geometry type of
|
||||
* @property {GeometryType} type Geometry type of
|
||||
* the geometries being drawn with this instance.
|
||||
* @property {number} [clickTolerance=6] The maximum distance in pixels between
|
||||
* "down" and "up" for a "up" event to be considered a "click" event and
|
||||
* actually add a point/vertex to the geometry being drawn. The default of `6`
|
||||
* was chosen for the draw interaction to behave correctly on mouse as well as
|
||||
* on touch devices.
|
||||
* @property {import("../Collection.js").default<import("../Feature.js").default>} [features]
|
||||
* @property {import("../Collection.js").default<Feature>} [features]
|
||||
* Destination collection for the drawn features.
|
||||
* @property {import("../source/Vector.js").default} [source] Destination source for
|
||||
* @property {VectorSource} [source] Destination source for
|
||||
* the drawn features.
|
||||
* @property {number} [dragVertexDelay=500] Delay in milliseconds after pointerdown
|
||||
* before the current vertex can be dragged to its exact position.
|
||||
@@ -131,7 +131,7 @@ const DrawEventType = {
|
||||
class DrawEvent extends Event {
|
||||
/**
|
||||
* @param {DrawEventType} type Type.
|
||||
* @param {import("../Feature.js").default} feature The feature drawn.
|
||||
* @param {Feature} feature The feature drawn.
|
||||
*/
|
||||
constructor(type, feature) {
|
||||
|
||||
@@ -139,7 +139,7 @@ class DrawEvent extends Event {
|
||||
|
||||
/**
|
||||
* The feature being drawn.
|
||||
* @type {import("../Feature.js").default}
|
||||
* @type {Feature}
|
||||
* @api
|
||||
*/
|
||||
this.feature = feature;
|
||||
@@ -201,14 +201,14 @@ class Draw extends PointerInteraction {
|
||||
|
||||
/**
|
||||
* Target source for drawn features.
|
||||
* @type {import("../source/Vector.js").default}
|
||||
* @type {VectorSource}
|
||||
* @private
|
||||
*/
|
||||
this.source_ = options.source ? options.source : null;
|
||||
|
||||
/**
|
||||
* Target collection for drawn features.
|
||||
* @type {import("../Collection.js").default<import("../Feature.js").default>}
|
||||
* @type {import("../Collection.js").default<Feature>}
|
||||
* @private
|
||||
*/
|
||||
this.features_ = options.features ? options.features : null;
|
||||
@@ -222,10 +222,10 @@ class Draw extends PointerInteraction {
|
||||
|
||||
/**
|
||||
* Geometry type.
|
||||
* @type {import("../geom/GeometryType.js").default}
|
||||
* @type {GeometryType}
|
||||
* @private
|
||||
*/
|
||||
this.type_ = /** @type {import("../geom/GeometryType.js").default} */ (options.type);
|
||||
this.type_ = /** @type {GeometryType} */ (options.type);
|
||||
|
||||
/**
|
||||
* Drawing mode (derived from geometry type.
|
||||
@@ -278,7 +278,7 @@ class Draw extends PointerInteraction {
|
||||
* @return {import("../geom/SimpleGeometry.js").default} A geometry.
|
||||
*/
|
||||
geometryFunction = function(coordinates, opt_geometry) {
|
||||
const circle = opt_geometry ? /** @type {import("../geom/Circle.js").default} */ (opt_geometry) :
|
||||
const circle = opt_geometry ? /** @type {Circle} */ (opt_geometry) :
|
||||
new Circle([NaN, NaN]);
|
||||
const squaredLength = squaredCoordinateDistance(
|
||||
coordinates[0], coordinates[1]);
|
||||
@@ -344,14 +344,14 @@ class Draw extends PointerInteraction {
|
||||
|
||||
/**
|
||||
* Sketch feature.
|
||||
* @type {import("../Feature.js").default}
|
||||
* @type {Feature}
|
||||
* @private
|
||||
*/
|
||||
this.sketchFeature_ = null;
|
||||
|
||||
/**
|
||||
* Sketch point.
|
||||
* @type {import("../Feature.js").default}
|
||||
* @type {Feature}
|
||||
* @private
|
||||
*/
|
||||
this.sketchPoint_ = null;
|
||||
@@ -365,7 +365,7 @@ class Draw extends PointerInteraction {
|
||||
|
||||
/**
|
||||
* Sketch line. Used when drawing polygon.
|
||||
* @type {import("../Feature.js").default}
|
||||
* @type {Feature}
|
||||
* @private
|
||||
*/
|
||||
this.sketchLine_ = null;
|
||||
@@ -389,7 +389,7 @@ class Draw extends PointerInteraction {
|
||||
|
||||
/**
|
||||
* Draw overlay where our sketch features are drawn.
|
||||
* @type {import("../layer/Vector.js").default}
|
||||
* @type {VectorLayer}
|
||||
* @private
|
||||
*/
|
||||
this.overlay_ = new VectorLayer({
|
||||
@@ -443,7 +443,7 @@ class Draw extends PointerInteraction {
|
||||
|
||||
/**
|
||||
* Get the overlay layer that this interaction renders sketch features to.
|
||||
* @return {import("../layer/Vector.js").default} Overlay layer.
|
||||
* @return {VectorLayer} Overlay layer.
|
||||
* @api
|
||||
*/
|
||||
getOverlay() {
|
||||
@@ -530,7 +530,7 @@ class Draw extends PointerInteraction {
|
||||
this.sketchPoint_ = new Feature(new Point(coordinates));
|
||||
this.updateSketchFeatures_();
|
||||
} else {
|
||||
const sketchPointGeom = /** @type {import("../geom/Point.js").default} */ (this.sketchPoint_.getGeometry());
|
||||
const sketchPointGeom = /** @type {Point} */ (this.sketchPoint_.getGeometry());
|
||||
sketchPointGeom.setCoordinates(coordinates);
|
||||
}
|
||||
}
|
||||
@@ -591,7 +591,7 @@ class Draw extends PointerInteraction {
|
||||
last[1] = coordinate[1];
|
||||
this.geometryFunction_(/** @type {!Array<import("../coordinate.js").Coordinate>} */ (this.sketchCoords_), geometry);
|
||||
if (this.sketchPoint_) {
|
||||
const sketchPointGeom = /** @type {import("../geom/Point.js").default} */ (this.sketchPoint_.getGeometry());
|
||||
const sketchPointGeom = /** @type {Point} */ (this.sketchPoint_.getGeometry());
|
||||
sketchPointGeom.setCoordinates(coordinate);
|
||||
}
|
||||
let sketchLineGeom;
|
||||
@@ -601,7 +601,7 @@ class Draw extends PointerInteraction {
|
||||
this.sketchLine_ = new Feature();
|
||||
}
|
||||
const ring = geometry.getLinearRing(0);
|
||||
sketchLineGeom = /** @type {import("../geom/LineString.js").default} */ (this.sketchLine_.getGeometry());
|
||||
sketchLineGeom = /** @type {LineString} */ (this.sketchLine_.getGeometry());
|
||||
if (!sketchLineGeom) {
|
||||
sketchLineGeom = new LineString(ring.getFlatCoordinates(), ring.getLayout());
|
||||
this.sketchLine_.setGeometry(sketchLineGeom);
|
||||
@@ -611,7 +611,7 @@ class Draw extends PointerInteraction {
|
||||
sketchLineGeom.changed();
|
||||
}
|
||||
} else if (this.sketchLineCoords_) {
|
||||
sketchLineGeom = /** @type {import("../geom/LineString.js").default} */ (this.sketchLine_.getGeometry());
|
||||
sketchLineGeom = /** @type {LineString} */ (this.sketchLine_.getGeometry());
|
||||
sketchLineGeom.setCoordinates(this.sketchLineCoords_);
|
||||
}
|
||||
this.updateSketchFeatures_();
|
||||
@@ -680,7 +680,7 @@ class Draw extends PointerInteraction {
|
||||
} else if (this.mode_ === Mode.POLYGON) {
|
||||
coordinates = this.sketchCoords_[0];
|
||||
coordinates.splice(-2, 1);
|
||||
sketchLineGeom = /** @type {import("../geom/LineString.js").default} */ (this.sketchLine_.getGeometry());
|
||||
sketchLineGeom = /** @type {LineString} */ (this.sketchLine_.getGeometry());
|
||||
sketchLineGeom.setCoordinates(coordinates);
|
||||
this.geometryFunction_(this.sketchCoords_, geometry);
|
||||
}
|
||||
@@ -739,7 +739,7 @@ class Draw extends PointerInteraction {
|
||||
|
||||
/**
|
||||
* Stop drawing without adding the sketch feature to the target layer.
|
||||
* @return {import("../Feature.js").default} The sketch feature (or null if none).
|
||||
* @return {Feature} The sketch feature (or null if none).
|
||||
* @private
|
||||
*/
|
||||
abortDrawing_() {
|
||||
@@ -758,12 +758,12 @@ class Draw extends PointerInteraction {
|
||||
* 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 {!import("../Feature.js").default} feature Feature to be extended.
|
||||
* @param {!Feature} feature Feature to be extended.
|
||||
* @api
|
||||
*/
|
||||
extend(feature) {
|
||||
const geometry = feature.getGeometry();
|
||||
const lineString = /** @type {import("../geom/LineString.js").default} */ (geometry);
|
||||
const lineString = /** @type {LineString} */ (geometry);
|
||||
this.sketchFeature_ = feature;
|
||||
this.sketchCoords_ = lineString.getCoordinates();
|
||||
const last = this.sketchCoords_[this.sketchCoords_.length - 1];
|
||||
@@ -873,7 +873,7 @@ export function handleEvent(event) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} event Event.
|
||||
* @param {MapBrowserPointerEvent} event Event.
|
||||
* @return {boolean} Start drag sequence?
|
||||
* @this {Draw}
|
||||
*/
|
||||
@@ -901,7 +901,7 @@ function handleDownEvent(event) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} event Event.
|
||||
* @param {MapBrowserPointerEvent} event Event.
|
||||
* @return {boolean} Stop drag sequence?
|
||||
* @this {Draw}
|
||||
*/
|
||||
@@ -963,7 +963,7 @@ export function createRegularPolygon(opt_sides, opt_angle) {
|
||||
const end = coordinates[1];
|
||||
const radius = Math.sqrt(
|
||||
squaredCoordinateDistance(center, end));
|
||||
const geometry = opt_geometry ? /** @type {import("../geom/Polygon.js").default} */ (opt_geometry) :
|
||||
const geometry = opt_geometry ? /** @type {Polygon} */ (opt_geometry) :
|
||||
fromCircle(new Circle(center), opt_sides);
|
||||
let angle = opt_angle;
|
||||
if (!opt_angle) {
|
||||
@@ -1010,7 +1010,7 @@ export function createBox() {
|
||||
/**
|
||||
* Get the drawing mode. The mode for mult-part geometries is the same as for
|
||||
* their single-part cousins.
|
||||
* @param {import("../geom/GeometryType.js").default} type Geometry type.
|
||||
* @param {GeometryType} type Geometry type.
|
||||
* @return {Mode} Drawing mode.
|
||||
*/
|
||||
function getMode(type) {
|
||||
|
||||
@@ -125,14 +125,14 @@ class ExtentInteraction extends PointerInteraction {
|
||||
|
||||
/**
|
||||
* Feature for displaying the visible extent
|
||||
* @type {import("../Feature.js").default}
|
||||
* @type {Feature}
|
||||
* @private
|
||||
*/
|
||||
this.extentFeature_ = null;
|
||||
|
||||
/**
|
||||
* Feature for displaying the visible pointer
|
||||
* @type {import("../Feature.js").default}
|
||||
* @type {Feature}
|
||||
* @private
|
||||
*/
|
||||
this.vertexFeature_ = null;
|
||||
@@ -143,7 +143,7 @@ class ExtentInteraction extends PointerInteraction {
|
||||
|
||||
/**
|
||||
* Layer for the extentFeature
|
||||
* @type {import("../layer/Vector.js").default}
|
||||
* @type {VectorLayer}
|
||||
* @private
|
||||
*/
|
||||
this.extentOverlay_ = new VectorLayer({
|
||||
@@ -158,7 +158,7 @@ class ExtentInteraction extends PointerInteraction {
|
||||
|
||||
/**
|
||||
* Layer for the vertexFeature
|
||||
* @type {import("../layer/Vector.js").default}
|
||||
* @type {VectorLayer}
|
||||
* @private
|
||||
*/
|
||||
this.vertexOverlay_ = new VectorLayer({
|
||||
@@ -235,7 +235,7 @@ class ExtentInteraction extends PointerInteraction {
|
||||
|
||||
/**
|
||||
* @param {import("../extent.js").Extent} extent extent
|
||||
* @returns {import("../Feature.js").default} extent as featrue
|
||||
* @returns {Feature} extent as featrue
|
||||
* @private
|
||||
*/
|
||||
createOrUpdateExtentFeature_(extent) {
|
||||
@@ -261,7 +261,7 @@ class ExtentInteraction extends PointerInteraction {
|
||||
|
||||
/**
|
||||
* @param {import("../coordinate.js").Coordinate} vertex location of feature
|
||||
* @returns {import("../Feature.js").default} vertex as feature
|
||||
* @returns {Feature} vertex as feature
|
||||
* @private
|
||||
*/
|
||||
createOrUpdatePointerFeature_(vertex) {
|
||||
@@ -271,7 +271,7 @@ class ExtentInteraction extends PointerInteraction {
|
||||
this.vertexFeature_ = vertexFeature;
|
||||
this.vertexOverlay_.getSource().addFeature(vertexFeature);
|
||||
} else {
|
||||
const geometry = /** @type {import("../geom/Point.js").default} */ (vertexFeature.getGeometry());
|
||||
const geometry = /** @type {Point} */ (vertexFeature.getGeometry());
|
||||
geometry.setCoordinates(vertex);
|
||||
}
|
||||
return vertexFeature;
|
||||
|
||||
@@ -61,7 +61,7 @@ const ModifyEventType = {
|
||||
/**
|
||||
* @typedef {Object} SegmentData
|
||||
* @property {Array<number>} [depth]
|
||||
* @property {import("../Feature.js").default} feature
|
||||
* @property {Feature} feature
|
||||
* @property {import("../geom/SimpleGeometry.js").default} geometry
|
||||
* @property {number} index
|
||||
* @property {Array<import("../extent.js").Extent>} segment
|
||||
@@ -90,10 +90,10 @@ const ModifyEventType = {
|
||||
* @property {import("../style/Style.js").default|Array<import("../style/Style.js").default>|import("../style/Style.js").StyleFunction} [style]
|
||||
* Style used for the features being modified. By default the default edit
|
||||
* style is used (see {@link module:ol/style}).
|
||||
* @property {import("../source/Vector.js").default} [source] The vector source with
|
||||
* @property {VectorSource} [source] The vector source with
|
||||
* features to modify. If a vector source is not provided, a feature collection
|
||||
* must be provided with the features option.
|
||||
* @property {import("../Collection.js").default<import("../Feature.js").default>} [features]
|
||||
* @property {Collection<Feature>} [features]
|
||||
* The features the interaction works on. If a feature collection is not
|
||||
* provided, a vector source must be provided with the source option.
|
||||
* @property {boolean} [wrapX=false] Wrap the world horizontally on the sketch
|
||||
@@ -109,9 +109,9 @@ const ModifyEventType = {
|
||||
export class ModifyEvent extends Event {
|
||||
/**
|
||||
* @param {ModifyEventType} type Type.
|
||||
* @param {import("../Collection.js").default<import("../Feature.js").default>} features
|
||||
* @param {Collection<Feature>} features
|
||||
* The features modified.
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} mapBrowserPointerEvent
|
||||
* @param {MapBrowserPointerEvent} mapBrowserPointerEvent
|
||||
* Associated {@link module:ol/MapBrowserPointerEvent}.
|
||||
*/
|
||||
constructor(type, features, mapBrowserPointerEvent) {
|
||||
@@ -119,7 +119,7 @@ export class ModifyEvent extends Event {
|
||||
|
||||
/**
|
||||
* The features being modified.
|
||||
* @type {import("../Collection.js").default<import("../Feature.js").default>}
|
||||
* @type {Collection<Feature>}
|
||||
* @api
|
||||
*/
|
||||
this.features = features;
|
||||
@@ -196,7 +196,7 @@ class Modify extends PointerInteraction {
|
||||
|
||||
/**
|
||||
* Editing vertex.
|
||||
* @type {import("../Feature.js").default}
|
||||
* @type {Feature}
|
||||
* @private
|
||||
*/
|
||||
this.vertexFeature_ = null;
|
||||
@@ -230,7 +230,7 @@ class Modify extends PointerInteraction {
|
||||
|
||||
/**
|
||||
* Segment RTree for each layer
|
||||
* @type {import("../structs/RBush.js").default<SegmentData>}
|
||||
* @type {RBush<SegmentData>}
|
||||
* @private
|
||||
*/
|
||||
this.rBush_ = new RBush();
|
||||
@@ -264,7 +264,7 @@ class Modify extends PointerInteraction {
|
||||
|
||||
/**
|
||||
* Draw overlay where sketch features are drawn.
|
||||
* @type {import("../layer/Vector.js").default}
|
||||
* @type {VectorLayer}
|
||||
* @private
|
||||
*/
|
||||
this.overlay_ = new VectorLayer({
|
||||
@@ -281,7 +281,7 @@ class Modify extends PointerInteraction {
|
||||
/**
|
||||
* @const
|
||||
* @private
|
||||
* @type {!Object<string, function(import("../Feature.js").default, import("../geom/Geometry.js").default)>}
|
||||
* @type {!Object<string, function(Feature, import("../geom/Geometry.js").default)>}
|
||||
*/
|
||||
this.SEGMENT_WRITERS_ = {
|
||||
'Point': this.writePointGeometry_,
|
||||
@@ -297,7 +297,7 @@ class Modify extends PointerInteraction {
|
||||
|
||||
|
||||
/**
|
||||
* @type {import("../source/Vector.js").default}
|
||||
* @type {VectorSource}
|
||||
* @private
|
||||
*/
|
||||
this.source_ = null;
|
||||
@@ -318,7 +318,7 @@ class Modify extends PointerInteraction {
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {import("../Collection.js").default<import("../Feature.js").default>}
|
||||
* @type {Collection<Feature>}
|
||||
* @private
|
||||
*/
|
||||
this.features_ = features;
|
||||
@@ -330,7 +330,7 @@ class Modify extends PointerInteraction {
|
||||
this.handleFeatureRemove_, this);
|
||||
|
||||
/**
|
||||
* @type {import("../MapBrowserPointerEvent.js").default}
|
||||
* @type {MapBrowserPointerEvent}
|
||||
* @private
|
||||
*/
|
||||
this.lastPointerEvent_ = null;
|
||||
@@ -338,7 +338,7 @@ class Modify extends PointerInteraction {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("../Feature.js").default} feature Feature.
|
||||
* @param {Feature} feature Feature.
|
||||
* @private
|
||||
*/
|
||||
addFeature_(feature) {
|
||||
@@ -355,7 +355,7 @@ class Modify extends PointerInteraction {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} evt Map browser event
|
||||
* @param {MapBrowserPointerEvent} evt Map browser event
|
||||
* @private
|
||||
*/
|
||||
willModifyFeatures_(evt) {
|
||||
@@ -367,7 +367,7 @@ class Modify extends PointerInteraction {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("../Feature.js").default} feature Feature.
|
||||
* @param {Feature} feature Feature.
|
||||
* @private
|
||||
*/
|
||||
removeFeature_(feature) {
|
||||
@@ -383,7 +383,7 @@ class Modify extends PointerInteraction {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("../Feature.js").default} feature Feature.
|
||||
* @param {Feature} feature Feature.
|
||||
* @private
|
||||
*/
|
||||
removeFeatureSegmentData_(feature) {
|
||||
@@ -424,7 +424,7 @@ class Modify extends PointerInteraction {
|
||||
|
||||
/**
|
||||
* Get the overlay layer that this interaction renders sketch features to.
|
||||
* @return {import("../layer/Vector.js").default} Overlay layer.
|
||||
* @return {VectorLayer} Overlay layer.
|
||||
* @api
|
||||
*/
|
||||
getOverlay() {
|
||||
@@ -456,7 +456,7 @@ class Modify extends PointerInteraction {
|
||||
* @private
|
||||
*/
|
||||
handleFeatureAdd_(evt) {
|
||||
this.addFeature_(/** @type {import("../Feature.js").default} */ (evt.element));
|
||||
this.addFeature_(/** @type {Feature} */ (evt.element));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -465,7 +465,7 @@ class Modify extends PointerInteraction {
|
||||
*/
|
||||
handleFeatureChange_(evt) {
|
||||
if (!this.changingFeature_) {
|
||||
const feature = /** @type {import("../Feature.js").default} */ (evt.target);
|
||||
const feature = /** @type {Feature} */ (evt.target);
|
||||
this.removeFeature_(feature);
|
||||
this.addFeature_(feature);
|
||||
}
|
||||
@@ -476,13 +476,13 @@ class Modify extends PointerInteraction {
|
||||
* @private
|
||||
*/
|
||||
handleFeatureRemove_(evt) {
|
||||
const feature = /** @type {import("../Feature.js").default} */ (evt.element);
|
||||
const feature = /** @type {Feature} */ (evt.element);
|
||||
this.removeFeature_(feature);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("../Feature.js").default} feature Feature
|
||||
* @param {import("../geom/Point.js").default} geometry Geometry.
|
||||
* @param {Feature} feature Feature
|
||||
* @param {Point} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
writePointGeometry_(feature, geometry) {
|
||||
@@ -496,7 +496,7 @@ class Modify extends PointerInteraction {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("../Feature.js").default} feature Feature
|
||||
* @param {Feature} feature Feature
|
||||
* @param {import("../geom/MultiPoint.js").default} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
@@ -516,7 +516,7 @@ class Modify extends PointerInteraction {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("../Feature.js").default} feature Feature
|
||||
* @param {Feature} feature Feature
|
||||
* @param {import("../geom/LineString.js").default} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
@@ -535,7 +535,7 @@ class Modify extends PointerInteraction {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("../Feature.js").default} feature Feature
|
||||
* @param {Feature} feature Feature
|
||||
* @param {import("../geom/MultiLineString.js").default} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
@@ -558,7 +558,7 @@ class Modify extends PointerInteraction {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("../Feature.js").default} feature Feature
|
||||
* @param {Feature} feature Feature
|
||||
* @param {import("../geom/Polygon.js").default} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
@@ -581,7 +581,7 @@ class Modify extends PointerInteraction {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("../Feature.js").default} feature Feature
|
||||
* @param {Feature} feature Feature
|
||||
* @param {import("../geom/MultiPolygon.js").default} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
@@ -613,7 +613,7 @@ class Modify extends PointerInteraction {
|
||||
* {@link CIRCLE_CIRCUMFERENCE_INDEX} is
|
||||
* the circumference, and is not a line segment.
|
||||
*
|
||||
* @param {import("../Feature.js").default} feature Feature.
|
||||
* @param {Feature} feature Feature.
|
||||
* @param {import("../geom/Circle.js").default} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
@@ -638,7 +638,7 @@ class Modify extends PointerInteraction {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("../Feature.js").default} feature Feature
|
||||
* @param {Feature} feature Feature
|
||||
* @param {import("../geom/GeometryCollection.js").default} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
@@ -651,7 +651,7 @@ class Modify extends PointerInteraction {
|
||||
|
||||
/**
|
||||
* @param {import("../coordinate.js").Coordinate} coordinates Coordinates.
|
||||
* @return {import("../Feature.js").default} Vertex feature.
|
||||
* @return {Feature} Vertex feature.
|
||||
* @private
|
||||
*/
|
||||
createOrUpdateVertexFeature_(coordinates) {
|
||||
@@ -661,7 +661,7 @@ class Modify extends PointerInteraction {
|
||||
this.vertexFeature_ = vertexFeature;
|
||||
this.overlay_.getSource().addFeature(vertexFeature);
|
||||
} else {
|
||||
const geometry = /** @type {import("../geom/Point.js").default} */ (vertexFeature.getGeometry());
|
||||
const geometry = /** @type {Point} */ (vertexFeature.getGeometry());
|
||||
geometry.setCoordinates(coordinates);
|
||||
}
|
||||
return vertexFeature;
|
||||
@@ -985,7 +985,7 @@ function compareIndexes(a, b) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} evt Event.
|
||||
* @param {MapBrowserPointerEvent} evt Event.
|
||||
* @return {boolean} Start drag sequence?
|
||||
* @this {Modify}
|
||||
*/
|
||||
@@ -1000,7 +1000,7 @@ function handleDownEvent(evt) {
|
||||
const vertexFeature = this.vertexFeature_;
|
||||
if (vertexFeature) {
|
||||
const insertVertices = [];
|
||||
const geometry = /** @type {import("../geom/Point.js").default} */ (vertexFeature.getGeometry());
|
||||
const geometry = /** @type {Point} */ (vertexFeature.getGeometry());
|
||||
const vertex = geometry.getCoordinates();
|
||||
const vertexExtent = boundingExtent([vertex]);
|
||||
const segmentDataMatches = this.rBush_.getInExtent(vertexExtent);
|
||||
@@ -1061,7 +1061,7 @@ function handleDownEvent(evt) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} evt Event.
|
||||
* @param {MapBrowserPointerEvent} evt Event.
|
||||
* @this {Modify}
|
||||
*/
|
||||
function handleDragEvent(evt) {
|
||||
@@ -1137,7 +1137,7 @@ function handleDragEvent(evt) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} evt Event.
|
||||
* @param {MapBrowserPointerEvent} evt Event.
|
||||
* @return {boolean} Stop drag sequence?
|
||||
* @this {Modify}
|
||||
*/
|
||||
|
||||
@@ -9,14 +9,14 @@ import {getValues} from '../obj.js';
|
||||
|
||||
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} mapBrowserEvent Event.
|
||||
* @param {MapBrowserPointerEvent} mapBrowserEvent Event.
|
||||
* @this {PointerInteraction}
|
||||
*/
|
||||
const handleDragEvent = VOID;
|
||||
|
||||
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} mapBrowserEvent Event.
|
||||
* @param {MapBrowserPointerEvent} mapBrowserEvent Event.
|
||||
* @return {boolean} Capture dragging.
|
||||
* @this {PointerInteraction}
|
||||
*/
|
||||
@@ -24,7 +24,7 @@ const handleUpEvent = FALSE;
|
||||
|
||||
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} mapBrowserEvent Event.
|
||||
* @param {MapBrowserPointerEvent} mapBrowserEvent Event.
|
||||
* @return {boolean} Capture dragging.
|
||||
* @this {PointerInteraction}
|
||||
*/
|
||||
@@ -32,7 +32,7 @@ const handleDownEvent = FALSE;
|
||||
|
||||
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} mapBrowserEvent Event.
|
||||
* @param {MapBrowserPointerEvent} mapBrowserEvent Event.
|
||||
* @this {PointerInteraction}
|
||||
*/
|
||||
const handleMoveEvent = VOID;
|
||||
@@ -40,10 +40,10 @@ const handleMoveEvent = VOID;
|
||||
|
||||
/**
|
||||
* @typedef {Object} Options
|
||||
* @property {function(import("../MapBrowserPointerEvent.js").default):boolean} [handleDownEvent]
|
||||
* @property {function(MapBrowserPointerEvent):boolean} [handleDownEvent]
|
||||
* Function handling "down" events. If the function returns `true` then a drag
|
||||
* sequence is started.
|
||||
* @property {function(import("../MapBrowserPointerEvent.js").default)} [handleDragEvent]
|
||||
* @property {function(MapBrowserPointerEvent)} [handleDragEvent]
|
||||
* Function handling "drag" events. This function is called on "move" events
|
||||
* during a drag sequence.
|
||||
* @property {function(import("../MapBrowserEvent.js").default):boolean} [handleEvent]
|
||||
@@ -51,11 +51,11 @@ const handleMoveEvent = VOID;
|
||||
* dispatched to the map. The function may return `false` to prevent the
|
||||
* propagation of the event to other interactions in the map's interactions
|
||||
* chain.
|
||||
* @property {function(import("../MapBrowserPointerEvent.js").default)} [handleMoveEvent]
|
||||
* @property {function(MapBrowserPointerEvent)} [handleMoveEvent]
|
||||
* Function handling "move" events. This function is called on "move" events,
|
||||
* also during a drag sequence (so during a drag sequence both the
|
||||
* `handleDragEvent` function and this function are called).
|
||||
* @property {function(import("../MapBrowserPointerEvent.js").default):boolean} [handleUpEvent]
|
||||
* @property {function(MapBrowserPointerEvent):boolean} [handleUpEvent]
|
||||
* Function handling "up" events. If the function returns `false` then the
|
||||
* current drag sequence is stopped.
|
||||
* @property {function(boolean):boolean} stopDown
|
||||
@@ -88,28 +88,28 @@ class PointerInteraction extends Interaction {
|
||||
});
|
||||
|
||||
/**
|
||||
* @type {function(import("../MapBrowserPointerEvent.js").default):boolean}
|
||||
* @type {function(MapBrowserPointerEvent):boolean}
|
||||
* @private
|
||||
*/
|
||||
this.handleDownEvent_ = options.handleDownEvent ?
|
||||
options.handleDownEvent : handleDownEvent;
|
||||
|
||||
/**
|
||||
* @type {function(import("../MapBrowserPointerEvent.js").default)}
|
||||
* @type {function(MapBrowserPointerEvent)}
|
||||
* @private
|
||||
*/
|
||||
this.handleDragEvent_ = options.handleDragEvent ?
|
||||
options.handleDragEvent : handleDragEvent;
|
||||
|
||||
/**
|
||||
* @type {function(import("../MapBrowserPointerEvent.js").default)}
|
||||
* @type {function(MapBrowserPointerEvent)}
|
||||
* @private
|
||||
*/
|
||||
this.handleMoveEvent_ = options.handleMoveEvent ?
|
||||
options.handleMoveEvent : handleMoveEvent;
|
||||
|
||||
/**
|
||||
* @type {function(import("../MapBrowserPointerEvent.js").default):boolean}
|
||||
* @type {function(MapBrowserPointerEvent):boolean}
|
||||
* @private
|
||||
*/
|
||||
this.handleUpEvent_ = options.handleUpEvent ?
|
||||
@@ -144,7 +144,7 @@ class PointerInteraction extends Interaction {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} mapBrowserEvent Event.
|
||||
* @param {MapBrowserPointerEvent} mapBrowserEvent Event.
|
||||
* @private
|
||||
*/
|
||||
updateTrackedPointers_(mapBrowserEvent) {
|
||||
@@ -185,7 +185,7 @@ export function centroid(pointerEvents) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} mapBrowserEvent Event.
|
||||
* @param {MapBrowserPointerEvent} mapBrowserEvent Event.
|
||||
* @return {boolean} Whether the event is a pointerdown, pointerdrag
|
||||
* or pointerup event.
|
||||
*/
|
||||
|
||||
@@ -222,7 +222,7 @@ class Select extends Interaction {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {import("../layer/Vector.js").default}
|
||||
* @type {VectorLayer}
|
||||
*/
|
||||
this.featureOverlay_ = featureOverlay;
|
||||
|
||||
@@ -296,19 +296,19 @@ class Select extends Interaction {
|
||||
* programmatic method like pushing features to
|
||||
* {@link module:ol/interaction/Select~Select#getFeatures collection}.
|
||||
* @param {import("../Feature.js").default|import("../render/Feature.js").default} feature Feature
|
||||
* @return {import("../layer/Vector.js").default} Layer.
|
||||
* @return {VectorLayer} Layer.
|
||||
* @api
|
||||
*/
|
||||
getLayer(feature) {
|
||||
const key = getUid(feature);
|
||||
return (
|
||||
/** @type {import("../layer/Vector.js").default} */ (this.featureLayerAssociation_[key])
|
||||
/** @type {VectorLayer} */ (this.featureLayerAssociation_[key])
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the overlay layer that this interaction renders selected features to.
|
||||
* @return {import("../layer/Vector.js").default} Overlay layer.
|
||||
* @return {VectorLayer} Overlay layer.
|
||||
* @api
|
||||
*/
|
||||
getOverlay() {
|
||||
|
||||
@@ -38,7 +38,7 @@ const TranslateEventType = {
|
||||
|
||||
/**
|
||||
* @typedef {Object} Options
|
||||
* @property {import("../Collection.js").default<import("../Feature.js").default>} [features] Only features contained in this collection will be able to be translated. If
|
||||
* @property {Collection<import("../Feature.js").default>} [features] Only features contained in this collection will be able to be translated. If
|
||||
* not specified, all features on the map will be able to be translated.
|
||||
* @property {Array<import("../layer/Layer.js").default>|function(import("../layer/Layer.js").default): boolean} [layers] A list of layers from which features should be
|
||||
* translated. Alternatively, a filter function can be provided. The
|
||||
@@ -59,7 +59,7 @@ const TranslateEventType = {
|
||||
export class TranslateEvent extends Event {
|
||||
/**
|
||||
* @param {TranslateEventType} type Type.
|
||||
* @param {import("../Collection.js").default<import("../Feature.js").default>} features The features translated.
|
||||
* @param {Collection<import("../Feature.js").default>} features The features translated.
|
||||
* @param {import("../coordinate.js").Coordinate} coordinate The event coordinate.
|
||||
*/
|
||||
constructor(type, features, coordinate) {
|
||||
@@ -68,7 +68,7 @@ export class TranslateEvent extends Event {
|
||||
|
||||
/**
|
||||
* The features being translated.
|
||||
* @type {import("../Collection.js").default<import("../Feature.js").default>}
|
||||
* @type {Collection<import("../Feature.js").default>}
|
||||
* @api
|
||||
*/
|
||||
this.features = features;
|
||||
@@ -116,7 +116,7 @@ class Translate extends PointerInteraction {
|
||||
|
||||
|
||||
/**
|
||||
* @type {import("../Collection.js").default<import("../Feature.js").default>}
|
||||
* @type {Collection<import("../Feature.js").default>}
|
||||
* @private
|
||||
*/
|
||||
this.features_ = options.features !== undefined ? options.features : null;
|
||||
|
||||
Reference in New Issue
Block a user