Shorter module paths for default exports
This commit is contained in:
@@ -46,8 +46,8 @@ const ModifyEventType = {
|
||||
/**
|
||||
* @typedef {Object} SegmentData
|
||||
* @property {Array.<number>} [depth]
|
||||
* @property {module:ol/Feature~Feature} feature
|
||||
* @property {module:ol/geom/SimpleGeometry~SimpleGeometry} geometry
|
||||
* @property {module:ol/Feature} feature
|
||||
* @property {module:ol/geom/SimpleGeometry} geometry
|
||||
* @property {number} index
|
||||
* @property {Array.<module:ol/extent~Extent>} segment
|
||||
* @property {Array.<module:ol/interaction/Modify~SegmentData>} [featureSegments]
|
||||
@@ -72,13 +72,13 @@ const ModifyEventType = {
|
||||
* features. Default is {@link module:ol/events/condition~always}.
|
||||
* @property {number} [pixelTolerance=10] Pixel tolerance for considering the
|
||||
* pointer close enough to a segment or vertex for editing.
|
||||
* @property {module:ol/style/Style~Style|Array.<module:ol/style/Style~Style>|module:ol/style~StyleFunction} [style]
|
||||
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style~StyleFunction} [style]
|
||||
* Style used for the features being modified. By default the default edit
|
||||
* style is used (see {@link module:ol/style}).
|
||||
* @property {module:ol/source/Vector~Vector} [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 {module:ol/Collection~Collection.<module:ol/Feature~Feature>} [features]
|
||||
* @property {module:ol/Collection.<module:ol/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
|
||||
@@ -92,13 +92,13 @@ const ModifyEventType = {
|
||||
* instances of this type.
|
||||
*
|
||||
* @constructor
|
||||
* @extends {module:ol/events/Event~Event}
|
||||
* @extends {module:ol/events/Event}
|
||||
* @implements {oli.ModifyEvent}
|
||||
* @param {ModifyEventType} type Type.
|
||||
* @param {module:ol/Collection~Collection.<module:ol/Feature~Feature>} features
|
||||
* @param {module:ol/Collection.<module:ol/Feature>} features
|
||||
* The features modified.
|
||||
* @param {module:ol/MapBrowserPointerEvent~MapBrowserPointerEvent} mapBrowserPointerEvent
|
||||
* Associated {@link module:ol/MapBrowserPointerEvent~MapBrowserPointerEvent}.
|
||||
* @param {module:ol/MapBrowserPointerEvent} mapBrowserPointerEvent
|
||||
* Associated {@link module:ol/MapBrowserPointerEvent}.
|
||||
*/
|
||||
export const ModifyEvent = function(type, features, mapBrowserPointerEvent) {
|
||||
|
||||
@@ -106,14 +106,14 @@ export const ModifyEvent = function(type, features, mapBrowserPointerEvent) {
|
||||
|
||||
/**
|
||||
* The features being modified.
|
||||
* @type {module:ol/Collection~Collection.<module:ol/Feature~Feature>}
|
||||
* @type {module:ol/Collection.<module:ol/Feature>}
|
||||
* @api
|
||||
*/
|
||||
this.features = features;
|
||||
|
||||
/**
|
||||
* Associated {@link module:ol/MapBrowserEvent~MapBrowserEvent}.
|
||||
* @type {module:ol/MapBrowserEvent~MapBrowserEvent}
|
||||
* Associated {@link module:ol/MapBrowserEvent}.
|
||||
* @type {module:ol/MapBrowserEvent}
|
||||
* @api
|
||||
*/
|
||||
this.mapBrowserEvent = mapBrowserPointerEvent;
|
||||
@@ -136,7 +136,7 @@ inherits(ModifyEvent, Event);
|
||||
* for deletion, use the `deleteCondition` option.
|
||||
*
|
||||
* @constructor
|
||||
* @extends {module:ol/interaction/Pointer~PointerInteraction}
|
||||
* @extends {module:ol/interaction/Pointer}
|
||||
* @param {module:ol/interaction/Modify~Options} options Options.
|
||||
* @fires module:ol/interaction/Modify~ModifyEvent
|
||||
* @api
|
||||
@@ -159,7 +159,7 @@ const Modify = function(options) {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Browser event.
|
||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Browser event.
|
||||
* @return {boolean} Combined condition result.
|
||||
*/
|
||||
this.defaultDeleteCondition_ = function(mapBrowserEvent) {
|
||||
@@ -182,7 +182,7 @@ const Modify = function(options) {
|
||||
|
||||
/**
|
||||
* Editing vertex.
|
||||
* @type {module:ol/Feature~Feature}
|
||||
* @type {module:ol/Feature}
|
||||
* @private
|
||||
*/
|
||||
this.vertexFeature_ = null;
|
||||
@@ -216,7 +216,7 @@ const Modify = function(options) {
|
||||
|
||||
/**
|
||||
* Segment RTree for each layer
|
||||
* @type {module:ol/structs/RBush~RBush.<module:ol/interaction/Modify~SegmentData>}
|
||||
* @type {module:ol/structs/RBush.<module:ol/interaction/Modify~SegmentData>}
|
||||
* @private
|
||||
*/
|
||||
this.rBush_ = new RBush();
|
||||
@@ -265,10 +265,10 @@ const Modify = function(options) {
|
||||
});
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @private
|
||||
* @type {!Object.<string, function(module:ol/Feature~Feature, module:ol/geom/Geometry~Geometry)>}
|
||||
*/
|
||||
* @const
|
||||
* @private
|
||||
* @type {!Object.<string, function(module:ol/Feature, module:ol/geom/Geometry)>}
|
||||
*/
|
||||
this.SEGMENT_WRITERS_ = {
|
||||
'Point': this.writePointGeometry_,
|
||||
'LineString': this.writeLineStringGeometry_,
|
||||
@@ -304,7 +304,7 @@ const Modify = function(options) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {module:ol/Collection~Collection.<module:ol/Feature~Feature>}
|
||||
* @type {module:ol/Collection.<module:ol/Feature>}
|
||||
* @private
|
||||
*/
|
||||
this.features_ = features;
|
||||
@@ -316,7 +316,7 @@ const Modify = function(options) {
|
||||
this.handleFeatureRemove_, this);
|
||||
|
||||
/**
|
||||
* @type {module:ol/MapBrowserPointerEvent~MapBrowserPointerEvent}
|
||||
* @type {module:ol/MapBrowserPointerEvent}
|
||||
* @private
|
||||
*/
|
||||
this.lastPointerEvent_ = null;
|
||||
@@ -342,7 +342,7 @@ const CIRCLE_CIRCUMFERENCE_INDEX = 1;
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/Feature~Feature} feature Feature.
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @private
|
||||
*/
|
||||
Modify.prototype.addFeature_ = function(feature) {
|
||||
@@ -360,7 +360,7 @@ Modify.prototype.addFeature_ = function(feature) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/MapBrowserPointerEvent~MapBrowserPointerEvent} evt Map browser event
|
||||
* @param {module:ol/MapBrowserPointerEvent} evt Map browser event
|
||||
* @private
|
||||
*/
|
||||
Modify.prototype.willModifyFeatures_ = function(evt) {
|
||||
@@ -373,7 +373,7 @@ Modify.prototype.willModifyFeatures_ = function(evt) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/Feature~Feature} feature Feature.
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @private
|
||||
*/
|
||||
Modify.prototype.removeFeature_ = function(feature) {
|
||||
@@ -390,7 +390,7 @@ Modify.prototype.removeFeature_ = function(feature) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/Feature~Feature} feature Feature.
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @private
|
||||
*/
|
||||
Modify.prototype.removeFeatureSegmentData_ = function(feature) {
|
||||
@@ -459,17 +459,17 @@ Modify.prototype.handleSourceRemove_ = function(event) {
|
||||
* @private
|
||||
*/
|
||||
Modify.prototype.handleFeatureAdd_ = function(evt) {
|
||||
this.addFeature_(/** @type {module:ol/Feature~Feature} */ (evt.element));
|
||||
this.addFeature_(/** @type {module:ol/Feature} */ (evt.element));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/events/Event~Event} evt Event.
|
||||
* @param {module:ol/events/Event} evt Event.
|
||||
* @private
|
||||
*/
|
||||
Modify.prototype.handleFeatureChange_ = function(evt) {
|
||||
if (!this.changingFeature_) {
|
||||
const feature = /** @type {module:ol/Feature~Feature} */ (evt.target);
|
||||
const feature = /** @type {module:ol/Feature} */ (evt.target);
|
||||
this.removeFeature_(feature);
|
||||
this.addFeature_(feature);
|
||||
}
|
||||
@@ -481,14 +481,14 @@ Modify.prototype.handleFeatureChange_ = function(evt) {
|
||||
* @private
|
||||
*/
|
||||
Modify.prototype.handleFeatureRemove_ = function(evt) {
|
||||
const feature = /** @type {module:ol/Feature~Feature} */ (evt.element);
|
||||
const feature = /** @type {module:ol/Feature} */ (evt.element);
|
||||
this.removeFeature_(feature);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/Feature~Feature} feature Feature
|
||||
* @param {module:ol/geom/Point~Point} geometry Geometry.
|
||||
* @param {module:ol/Feature} feature Feature
|
||||
* @param {module:ol/geom/Point} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
Modify.prototype.writePointGeometry_ = function(feature, geometry) {
|
||||
@@ -503,8 +503,8 @@ Modify.prototype.writePointGeometry_ = function(feature, geometry) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/Feature~Feature} feature Feature
|
||||
* @param {module:ol/geom/MultiPoint~MultiPoint} geometry Geometry.
|
||||
* @param {module:ol/Feature} feature Feature
|
||||
* @param {module:ol/geom/MultiPoint} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
Modify.prototype.writeMultiPointGeometry_ = function(feature, geometry) {
|
||||
@@ -524,8 +524,8 @@ Modify.prototype.writeMultiPointGeometry_ = function(feature, geometry) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/Feature~Feature} feature Feature
|
||||
* @param {module:ol/geom/LineString~LineString} geometry Geometry.
|
||||
* @param {module:ol/Feature} feature Feature
|
||||
* @param {module:ol/geom/LineString} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
Modify.prototype.writeLineStringGeometry_ = function(feature, geometry) {
|
||||
@@ -544,8 +544,8 @@ Modify.prototype.writeLineStringGeometry_ = function(feature, geometry) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/Feature~Feature} feature Feature
|
||||
* @param {module:ol/geom/MultiLineString~MultiLineString} geometry Geometry.
|
||||
* @param {module:ol/Feature} feature Feature
|
||||
* @param {module:ol/geom/MultiLineString} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
Modify.prototype.writeMultiLineStringGeometry_ = function(feature, geometry) {
|
||||
@@ -568,8 +568,8 @@ Modify.prototype.writeMultiLineStringGeometry_ = function(feature, geometry) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/Feature~Feature} feature Feature
|
||||
* @param {module:ol/geom/Polygon~Polygon} geometry Geometry.
|
||||
* @param {module:ol/Feature} feature Feature
|
||||
* @param {module:ol/geom/Polygon} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
Modify.prototype.writePolygonGeometry_ = function(feature, geometry) {
|
||||
@@ -592,8 +592,8 @@ Modify.prototype.writePolygonGeometry_ = function(feature, geometry) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/Feature~Feature} feature Feature
|
||||
* @param {module:ol/geom/MultiPolygon~MultiPolygon} geometry Geometry.
|
||||
* @param {module:ol/Feature} feature Feature
|
||||
* @param {module:ol/geom/MultiPolygon} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
Modify.prototype.writeMultiPolygonGeometry_ = function(feature, geometry) {
|
||||
@@ -625,8 +625,8 @@ Modify.prototype.writeMultiPolygonGeometry_ = function(feature, geometry) {
|
||||
* {@link CIRCLE_CIRCUMFERENCE_INDEX} is
|
||||
* the circumference, and is not a line segment.
|
||||
*
|
||||
* @param {module:ol/Feature~Feature} feature Feature.
|
||||
* @param {module:ol/geom/Circle~Circle} geometry Geometry.
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {module:ol/geom/Circle} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
Modify.prototype.writeCircleGeometry_ = function(feature, geometry) {
|
||||
@@ -651,8 +651,8 @@ Modify.prototype.writeCircleGeometry_ = function(feature, geometry) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/Feature~Feature} feature Feature
|
||||
* @param {module:ol/geom/GeometryCollection~GeometryCollection} geometry Geometry.
|
||||
* @param {module:ol/Feature} feature Feature
|
||||
* @param {module:ol/geom/GeometryCollection} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
Modify.prototype.writeGeometryCollectionGeometry_ = function(feature, geometry) {
|
||||
@@ -665,7 +665,7 @@ Modify.prototype.writeGeometryCollectionGeometry_ = function(feature, geometry)
|
||||
|
||||
/**
|
||||
* @param {module:ol/coordinate~Coordinate} coordinates Coordinates.
|
||||
* @return {module:ol/Feature~Feature} Vertex feature.
|
||||
* @return {module:ol/Feature} Vertex feature.
|
||||
* @private
|
||||
*/
|
||||
Modify.prototype.createOrUpdateVertexFeature_ = function(coordinates) {
|
||||
@@ -675,7 +675,7 @@ Modify.prototype.createOrUpdateVertexFeature_ = function(coordinates) {
|
||||
this.vertexFeature_ = vertexFeature;
|
||||
this.overlay_.getSource().addFeature(vertexFeature);
|
||||
} else {
|
||||
const geometry = /** @type {module:ol/geom/Point~Point} */ (vertexFeature.getGeometry());
|
||||
const geometry = /** @type {module:ol/geom/Point} */ (vertexFeature.getGeometry());
|
||||
geometry.setCoordinates(coordinates);
|
||||
}
|
||||
return vertexFeature;
|
||||
@@ -693,9 +693,9 @@ function compareIndexes(a, b) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/MapBrowserPointerEvent~MapBrowserPointerEvent} evt Event.
|
||||
* @param {module:ol/MapBrowserPointerEvent} evt Event.
|
||||
* @return {boolean} Start drag sequence?
|
||||
* @this {module:ol/interaction/Modify~Modify}
|
||||
* @this {module:ol/interaction/Modify}
|
||||
*/
|
||||
function handleDownEvent(evt) {
|
||||
if (!this.condition_(evt)) {
|
||||
@@ -708,7 +708,7 @@ function handleDownEvent(evt) {
|
||||
const vertexFeature = this.vertexFeature_;
|
||||
if (vertexFeature) {
|
||||
const insertVertices = [];
|
||||
const geometry = /** @type {module:ol/geom/Point~Point} */ (vertexFeature.getGeometry());
|
||||
const geometry = /** @type {module:ol/geom/Point} */ (vertexFeature.getGeometry());
|
||||
const vertex = geometry.getCoordinates();
|
||||
const vertexExtent = boundingExtent([vertex]);
|
||||
const segmentDataMatches = this.rBush_.getInExtent(vertexExtent);
|
||||
@@ -769,8 +769,8 @@ function handleDownEvent(evt) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/MapBrowserPointerEvent~MapBrowserPointerEvent} evt Event.
|
||||
* @this {module:ol/interaction/Modify~Modify}
|
||||
* @param {module:ol/MapBrowserPointerEvent} evt Event.
|
||||
* @this {module:ol/interaction/Modify}
|
||||
*/
|
||||
function handleDragEvent(evt) {
|
||||
this.ignoreNextSingleClick_ = false;
|
||||
@@ -845,9 +845,9 @@ function handleDragEvent(evt) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/MapBrowserPointerEvent~MapBrowserPointerEvent} evt Event.
|
||||
* @param {module:ol/MapBrowserPointerEvent} evt Event.
|
||||
* @return {boolean} Stop drag sequence?
|
||||
* @this {module:ol/interaction/Modify~Modify}
|
||||
* @this {module:ol/interaction/Modify}
|
||||
*/
|
||||
function handleUpEvent(evt) {
|
||||
for (let i = this.dragSegments_.length - 1; i >= 0; --i) {
|
||||
@@ -875,11 +875,11 @@ function handleUpEvent(evt) {
|
||||
|
||||
|
||||
/**
|
||||
* Handles the {@link module:ol/MapBrowserEvent~MapBrowserEvent map browser event} and may modify the
|
||||
* Handles the {@link module:ol/MapBrowserEvent map browser event} and may modify the
|
||||
* geometry.
|
||||
* @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} `false` to stop event propagation.
|
||||
* @this {module:ol/interaction/Modify~Modify}
|
||||
* @this {module:ol/interaction/Modify}
|
||||
*/
|
||||
function handleEvent(mapBrowserEvent) {
|
||||
if (!(mapBrowserEvent instanceof MapBrowserPointerEvent)) {
|
||||
@@ -910,7 +910,7 @@ function handleEvent(mapBrowserEvent) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/MapBrowserEvent~MapBrowserEvent} evt Event.
|
||||
* @param {module:ol/MapBrowserEvent} evt Event.
|
||||
* @private
|
||||
*/
|
||||
Modify.prototype.handlePointerMove_ = function(evt) {
|
||||
@@ -921,7 +921,7 @@ Modify.prototype.handlePointerMove_ = function(evt) {
|
||||
|
||||
/**
|
||||
* @param {module:ol~Pixel} pixel Pixel
|
||||
* @param {module:ol/PluggableMap~PluggableMap} map Map.
|
||||
* @param {module:ol/PluggableMap} map Map.
|
||||
* @private
|
||||
*/
|
||||
Modify.prototype.handlePointerAtPixel_ = function(pixel, map) {
|
||||
@@ -1000,7 +1000,7 @@ function pointDistanceToSegmentDataSquared(pointCoordinates, segmentData) {
|
||||
const geometry = segmentData.geometry;
|
||||
|
||||
if (geometry.getType() === GeometryType.CIRCLE) {
|
||||
const circleGeometry = /** @type {module:ol/geom/Circle~Circle} */ (geometry);
|
||||
const circleGeometry = /** @type {module:ol/geom/Circle} */ (geometry);
|
||||
|
||||
if (segmentData.index === CIRCLE_CIRCUMFERENCE_INDEX) {
|
||||
const distanceToCenterSquared =
|
||||
@@ -1235,7 +1235,7 @@ Modify.prototype.removeVertex_ = function() {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/SimpleGeometry~SimpleGeometry} geometry Geometry.
|
||||
* @param {module:ol/geom/SimpleGeometry} geometry Geometry.
|
||||
* @param {Array} coordinates Coordinates.
|
||||
* @private
|
||||
*/
|
||||
@@ -1247,7 +1247,7 @@ Modify.prototype.setGeometryCoordinates_ = function(geometry, coordinates) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/SimpleGeometry~SimpleGeometry} geometry Geometry.
|
||||
* @param {module:ol/geom/SimpleGeometry} geometry Geometry.
|
||||
* @param {number} index Index.
|
||||
* @param {Array.<number>|undefined} depth Depth.
|
||||
* @param {number} delta Delta (1 or -1).
|
||||
|
||||
Reference in New Issue
Block a user