Merge pull request #2988 from bartvde/radius1-olx

Correct olx.style.RegularShapeOptions definition (r=@elemoine)
This commit is contained in:
Bart van den Eijnden
2014-11-29 14:08:40 +01:00
2 changed files with 14 additions and 9 deletions
+8 -8
View File
@@ -5656,10 +5656,10 @@ olx.style.IconOptions.prototype.src;
* Specify radius for regular polygons, or radius1 and radius2 for stars. * Specify radius for regular polygons, or radius1 and radius2 for stars.
* @typedef {{fill: (ol.style.Fill|undefined), * @typedef {{fill: (ol.style.Fill|undefined),
* points: number, * points: number,
* radius: number, * radius: (number|undefined),
* radius1: number, * radius1: (number|undefined),
* radius2: number, * radius2: (number|undefined),
* angle: number, * angle: (number|undefined),
* snapToPixel: (boolean|undefined), * snapToPixel: (boolean|undefined),
* stroke: (ol.style.Stroke|undefined)}} * stroke: (ol.style.Stroke|undefined)}}
* @api * @api
@@ -5686,7 +5686,7 @@ olx.style.RegularShapeOptions.prototype.points;
/** /**
* Radius of a regular polygon. * Radius of a regular polygon.
* @type {number} * @type {number|undefined}
* @api * @api
*/ */
olx.style.RegularShapeOptions.prototype.radius; olx.style.RegularShapeOptions.prototype.radius;
@@ -5694,7 +5694,7 @@ olx.style.RegularShapeOptions.prototype.radius;
/** /**
* Inner radius of a star. * Inner radius of a star.
* @type {number} * @type {number|undefined}
* @api * @api
*/ */
olx.style.RegularShapeOptions.prototype.radius1; olx.style.RegularShapeOptions.prototype.radius1;
@@ -5702,7 +5702,7 @@ olx.style.RegularShapeOptions.prototype.radius1;
/** /**
* Outer radius of a star. * Outer radius of a star.
* @type {number} * @type {number|undefined}
* @api * @api
*/ */
olx.style.RegularShapeOptions.prototype.radius2; olx.style.RegularShapeOptions.prototype.radius2;
@@ -5712,7 +5712,7 @@ olx.style.RegularShapeOptions.prototype.radius2;
* Shape's rotation in radians. A value of 0 will have one of the shape's point * Shape's rotation in radians. A value of 0 will have one of the shape's point
* facing up. * facing up.
* Default value is 0. * Default value is 0.
* @type {number} * @type {number|undefined}
* @api * @api
*/ */
olx.style.RegularShapeOptions.prototype.angle; olx.style.RegularShapeOptions.prototype.angle;
+6 -1
View File
@@ -1,5 +1,6 @@
goog.provide('ol.style.RegularShape'); goog.provide('ol.style.RegularShape');
goog.require('goog.asserts');
goog.require('goog.dom'); goog.require('goog.dom');
goog.require('goog.dom.TagName'); goog.require('goog.dom.TagName');
goog.require('ol.color'); goog.require('ol.color');
@@ -58,11 +59,15 @@ ol.style.RegularShape = function(opt_options) {
*/ */
this.points_ = options.points; this.points_ = options.points;
goog.asserts.assert(goog.isDef(options.radius) ||
goog.isDef(options.radius1));
/** /**
* @private * @private
* @type {number} * @type {number}
*/ */
this.radius_ = goog.isDef(options.radius) ? options.radius : options.radius1; this.radius_ = /** @type {number} */ (goog.isDef(options.radius) ?
options.radius : options.radius1);
/** /**
* @private * @private