Fix ol.DrawGeometryFunctionType coordinates argument type

This commit is contained in:
Frederic Junod
2017-05-10 13:36:27 +02:00
parent 366bf46ca1
commit 55de3020d3
2 changed files with 6 additions and 9 deletions

View File

@@ -127,7 +127,7 @@ ol.interaction.Draw = function(options) {
if (!geometryFunction) {
if (this.type_ === ol.geom.GeometryType.CIRCLE) {
/**
* @param {ol.Coordinate|Array.<ol.Coordinate>|Array.<Array.<ol.Coordinate>>} coordinates
* @param {!Array.<ol.Coordinate>} coordinates
* The coordinates.
* @param {ol.geom.SimpleGeometry=} opt_geometry Optional geometry.
* @return {ol.geom.SimpleGeometry} A geometry.
@@ -151,7 +151,7 @@ ol.interaction.Draw = function(options) {
Constructor = ol.geom.Polygon;
}
/**
* @param {ol.Coordinate|Array.<ol.Coordinate>|Array.<Array.<ol.Coordinate>>} coordinates
* @param {!Array.<ol.Coordinate>} coordinates
* The coordinates.
* @param {ol.geom.SimpleGeometry=} opt_geometry Optional geometry.
* @return {ol.geom.SimpleGeometry} A geometry.
@@ -529,9 +529,7 @@ ol.interaction.Draw.prototype.modifyDrawing_ = function(event) {
}
last[0] = coordinate[0];
last[1] = coordinate[1];
this.geometryFunction_(
/** @type {!ol.Coordinate|!Array.<ol.Coordinate>|!Array.<Array.<ol.Coordinate>>} */ (this.sketchCoords_),
geometry);
this.geometryFunction_(/** @type {!Array.<ol.Coordinate>} */ (this.sketchCoords_), geometry);
if (this.sketchPoint_) {
var sketchPointGeom = /** @type {ol.geom.Point} */ (this.sketchPoint_.getGeometry());
sketchPointGeom.setCoordinates(coordinate);
@@ -800,7 +798,7 @@ ol.interaction.Draw.createRegularPolygon = function(opt_sides, opt_angle) {
ol.interaction.Draw.createBox = function() {
return (
/**
* @param {ol.Coordinate|Array.<ol.Coordinate>|Array.<Array.<ol.Coordinate>>} coordinates
* @param {Array.<ol.Coordinate>} coordinates
* @param {ol.geom.SimpleGeometry=} opt_geometry
* @return {ol.geom.SimpleGeometry}
*/

View File

@@ -156,12 +156,11 @@ ol.DragBoxEndConditionType;
/**
* Function that takes coordinates and an optional existing geometry as
* Function that takes an array of coordinates and an optional existing geometry as
* arguments, and returns a geometry. The optional existing geometry is the
* geometry that is returned when the function is called without a second
* argument.
* @typedef {function(!(ol.Coordinate|Array.<ol.Coordinate>|
* Array.<Array.<ol.Coordinate>>), ol.geom.SimpleGeometry=):
* @typedef {function(!Array.<ol.Coordinate>, ol.geom.SimpleGeometry=):
* ol.geom.SimpleGeometry}
*/
ol.DrawGeometryFunctionType;