No olx and ol types for ol/interaction/Draw

This commit is contained in:
ahocevar
2018-03-15 17:51:19 +01:00
parent 2c6afdd5bb
commit b19f00d893
4 changed files with 88 additions and 253 deletions
-176
View File
@@ -5,182 +5,6 @@
let olx;
/**
* @typedef {{clickTolerance: (number|undefined),
* features: (ol.Collection.<module:ol/Feature~Feature>|undefined),
* source: (ol.source.Vector|undefined),
* dragVertexDelay: (number|undefined),
* snapTolerance: (number|undefined),
* type: (module:ol/geom/GeometryType~GeometryType|string),
* stopClick: (boolean|undefined),
* maxPoints: (number|undefined),
* minPoints: (number|undefined),
* finishCondition: (ol.EventsConditionType|undefined),
* style: (ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction|undefined),
* geometryFunction: (ol.DrawGeometryFunctionType|undefined),
* geometryName: (string|undefined),
* condition: (ol.EventsConditionType|undefined),
* freehand: (boolean|undefined),
* freehandCondition: (ol.EventsConditionType|undefined),
* wrapX: (boolean|undefined)}}
*/
olx.interaction.DrawOptions;
/**
* 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. Default is 6 pixels. That value was chosen for
* the draw interaction to behave correctly on mouse as well as on touch
* devices.
* @type {number|undefined}
* @api
*/
olx.interaction.DrawOptions.prototype.clickTolerance;
/**
* Destination collection for the drawn features.
* @type {ol.Collection.<module:ol/Feature~Feature>|undefined}
* @api
*/
olx.interaction.DrawOptions.prototype.features;
/**
* Destination source for the drawn features.
* @type {ol.source.Vector|undefined}
* @api
*/
olx.interaction.DrawOptions.prototype.source;
/**
* Delay in milliseconds after pointerdown before the current vertex can be
* dragged to its exact position. Default is 500 ms.
* @type {number|undefined}
*/
olx.interaction.DrawOptions.prototype.dragVertexDelay;
/**
* Pixel distance for snapping to the drawing finish. Default is `12`.
* @type {number|undefined}
* @api
*/
olx.interaction.DrawOptions.prototype.snapTolerance;
/**
* Drawing type ('Point', 'LineString', 'Polygon', 'MultiPoint',
* 'MultiLineString', 'MultiPolygon' or 'Circle').
* @type {module:ol/geom/GeometryType~GeometryType|string}
* @api
*/
olx.interaction.DrawOptions.prototype.type;
/**
* Stop click, singleclick, and doubleclick events from firing during drawing.
* Default is `false`.
* @type {boolean|undefined}
* @api
*/
olx.interaction.DrawOptions.prototype.stopClick;
/**
* The number of points that can be drawn before a polygon ring or line string
* is finished. The default is no restriction.
* @type {number|undefined}
* @api
*/
olx.interaction.DrawOptions.prototype.maxPoints;
/**
* The number of points that must be drawn before a polygon ring or line string
* can be finished. Default is `3` for polygon rings and `2` for line strings.
* @type {number|undefined}
* @api
*/
olx.interaction.DrawOptions.prototype.minPoints;
/**
* A function that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a boolean
* to indicate whether the drawing can be finished.
* @type {ol.EventsConditionType|undefined}
* @api
*/
olx.interaction.DrawOptions.prototype.finishCondition;
/**
* Style for sketch features.
* @type {ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction|undefined}
* @api
*/
olx.interaction.DrawOptions.prototype.style;
/**
* Function that is called when a geometry's coordinates are updated.
* @type {ol.DrawGeometryFunctionType|undefined}
* @api
*/
olx.interaction.DrawOptions.prototype.geometryFunction;
/**
* Geometry name to use for features created by the draw interaction.
* @type {string|undefined}
* @api
*/
olx.interaction.DrawOptions.prototype.geometryName;
/**
* A function that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a boolean
* to indicate whether that event should be handled.
* By default {@link ol.events.condition.noModifierKeys}, i.e. a click, adds a
* vertex or deactivates freehand drawing.
* @type {ol.EventsConditionType|undefined}
* @api
*/
olx.interaction.DrawOptions.prototype.condition;
/**
* Operate in freehand mode for lines, polygons, and circles. This makes the
* interaction always operate in freehand mode and takes precedence over any
* `freehandCondition` option.
* @type {boolean|undefined}
* @api
*/
olx.interaction.DrawOptions.prototype.freehand;
/**
* Condition that activates freehand drawing for lines and polygons. This
* function takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a boolean to
* indicate whether that event should be handled. The default is
* {@link ol.events.condition.shiftKeyOnly}, meaning that the Shift key
* activates freehand drawing.
* @type {ol.EventsConditionType|undefined}
* @api
*/
olx.interaction.DrawOptions.prototype.freehandCondition;
/**
* Wrap the world horizontally on the sketch overlay. Default is `false`.
* @type {boolean|undefined}
* @api
*/
olx.interaction.DrawOptions.prototype.wrapX;
/**
* @typedef {{extent: (ol.Extent|undefined),
* boxStyle: (ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction|undefined),
-41
View File
@@ -1,45 +1,4 @@
/**
* @typedef {Object} interaction_DrawOptions
* @property {number|undefined} clickTolerance 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. Default is 6 pixels. That value was chosen for
* the draw interaction to behave correctly on mouse as well as on touch
* devices.
* @property {ol.Collection.<module:ol/Feature~Feature>|undefined} features Destination collection for the drawn features.
* @property {ol.source.Vector|undefined} source Destination source for the drawn features.
* @property {number|undefined} dragVertexDelay Delay in milliseconds after pointerdown before the current vertex can be
* dragged to its exact position. Default is 500 ms.
* @property {number|undefined} snapTolerance Pixel distance for snapping to the drawing finish. Default is `12`.
* @property {module:ol/geom/GeometryType~GeometryType|string} type Drawing type ('Point', 'LineString', 'Polygon', 'MultiPoint',
* 'MultiLineString', 'MultiPolygon' or 'Circle').
* @property {boolean|undefined} stopClick Stop click, singleclick, and doubleclick events from firing during drawing.
* Default is `false`.
* @property {number|undefined} maxPoints The number of points that can be drawn before a polygon ring or line string
* is finished. The default is no restriction.
* @property {number|undefined} minPoints The number of points that must be drawn before a polygon ring or line string
* can be finished. Default is `3` for polygon rings and `2` for line strings.
* @property {ol.EventsConditionType|undefined} finishCondition A function that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a boolean
* to indicate whether the drawing can be finished.
* @property {ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction|undefined} style Style for sketch features.
* @property {ol.DrawGeometryFunctionType|undefined} geometryFunction Function that is called when a geometry's coordinates are updated.
* @property {string|undefined} geometryName Geometry name to use for features created by the draw interaction.
* @property {ol.EventsConditionType|undefined} condition A function that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a boolean
* to indicate whether that event should be handled.
* By default {@link ol.events.condition.noModifierKeys}, i.e. a click, adds a
* vertex or deactivates freehand drawing.
* @property {boolean|undefined} freehand Operate in freehand mode for lines, polygons, and circles. This makes the
* interaction always operate in freehand mode and takes precedence over any
* `freehandCondition` option.
* @property {ol.EventsConditionType|undefined} freehandCondition Condition that activates freehand drawing for lines and polygons. This
* function takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a boolean to
* indicate whether that event should be handled. The default is
* {@link ol.events.condition.shiftKeyOnly}, meaning that the Shift key
* activates freehand drawing.
* @property {boolean|undefined} wrapX Wrap the world horizontally on the sketch overlay. Default is `false`.
*/
/**
* @typedef {Object} interaction_ExtentOptions
* @property {ol.Extent|undefined} extent Initial extent. Defaults to no initial extent