Be more consistent with style options

This commit is contained in:
Tom Payne
2013-04-06 19:26:02 +02:00
parent 3f637ec2c4
commit dfc4dcc5f9
4 changed files with 43 additions and 41 deletions
+8 -8
View File
@@ -23,24 +23,24 @@ ol.style.IconLiteralOptions;
/** /**
* @constructor * @constructor
* @extends {ol.style.PointLiteral} * @extends {ol.style.PointLiteral}
* @param {ol.style.IconLiteralOptions} config Symbolizer properties. * @param {ol.style.IconLiteralOptions} options Icon literal options.
*/ */
ol.style.IconLiteral = function(config) { ol.style.IconLiteral = function(options) {
/** @type {string} */ /** @type {string} */
this.url = config.url; this.url = options.url;
/** @type {number|undefined} */ /** @type {number|undefined} */
this.width = config.width; this.width = options.width;
/** @type {number|undefined} */ /** @type {number|undefined} */
this.height = config.height; this.height = options.height;
/** @type {number} */ /** @type {number} */
this.opacity = config.opacity; this.opacity = options.opacity;
/** @type {number} */ /** @type {number} */
this.rotation = config.rotation; this.rotation = options.rotation;
}; };
goog.inherits(ol.style.IconLiteral, ol.style.PointLiteral); goog.inherits(ol.style.IconLiteral, ol.style.PointLiteral);
@@ -62,7 +62,7 @@ ol.style.IconLiteral.prototype.equals = function(iconLiteral) {
/** /**
* @constructor * @constructor
* @extends {ol.style.Point} * @extends {ol.style.Point}
* @param {ol.style.IconOptions} options Symbolizer properties. * @param {ol.style.IconOptions} options Icon options.
*/ */
ol.style.Icon = function(options) { ol.style.Icon = function(options) {
+11 -9
View File
@@ -20,22 +20,24 @@ ol.style.LineLiteralOptions;
/** /**
* @constructor * @constructor
* @extends {ol.style.SymbolizerLiteral} * @extends {ol.style.SymbolizerLiteral}
* @param {ol.style.LineLiteralOptions} config Symbolizer properties. * @param {ol.style.LineLiteralOptions} options Line literal options.
*/ */
ol.style.LineLiteral = function(config) { ol.style.LineLiteral = function(options) {
goog.base(this); goog.base(this);
goog.asserts.assertString(config.strokeColor, 'strokeColor must be a string'); goog.asserts.assertString(
options.strokeColor, 'strokeColor must be a string');
/** @type {string} */ /** @type {string} */
this.strokeColor = config.strokeColor; this.strokeColor = options.strokeColor;
goog.asserts.assertNumber(config.strokeWidth, 'strokeWidth must be a number'); goog.asserts.assertNumber(
options.strokeWidth, 'strokeWidth must be a number');
/** @type {number} */ /** @type {number} */
this.strokeWidth = config.strokeWidth; this.strokeWidth = options.strokeWidth;
goog.asserts.assertNumber(config.opacity, 'opacity must be a number'); goog.asserts.assertNumber(options.opacity, 'opacity must be a number');
/** @type {number} */ /** @type {number} */
this.opacity = config.opacity; this.opacity = options.opacity;
}; };
goog.inherits(ol.style.LineLiteral, ol.style.SymbolizerLiteral); goog.inherits(ol.style.LineLiteral, ol.style.SymbolizerLiteral);
@@ -55,7 +57,7 @@ ol.style.LineLiteral.prototype.equals = function(lineLiteral) {
/** /**
* @constructor * @constructor
* @extends {ol.style.Symbolizer} * @extends {ol.style.Symbolizer}
* @param {ol.style.LineOptions} options Symbolizer properties. * @param {ol.style.LineOptions} options Line options.
*/ */
ol.style.Line = function(options) { ol.style.Line = function(options) {
goog.base(this); goog.base(this);
+10 -10
View File
@@ -21,26 +21,26 @@ ol.style.PolygonLiteralOptions;
/** /**
* @constructor * @constructor
* @extends {ol.style.SymbolizerLiteral} * @extends {ol.style.SymbolizerLiteral}
* @param {ol.style.PolygonLiteralOptions} config Symbolizer properties. * @param {ol.style.PolygonLiteralOptions} options Polygon literal options.
*/ */
ol.style.PolygonLiteral = function(config) { ol.style.PolygonLiteral = function(options) {
goog.base(this); goog.base(this);
/** @type {string|undefined} */ /** @type {string|undefined} */
this.fillColor = config.fillColor; this.fillColor = options.fillColor;
if (goog.isDef(config.fillColor)) { if (goog.isDef(options.fillColor)) {
goog.asserts.assertString(config.fillColor, 'fillColor must be a string'); goog.asserts.assertString(options.fillColor, 'fillColor must be a string');
} }
/** @type {string|undefined} */ /** @type {string|undefined} */
this.strokeColor = config.strokeColor; this.strokeColor = options.strokeColor;
if (goog.isDef(this.strokeColor)) { if (goog.isDef(this.strokeColor)) {
goog.asserts.assertString( goog.asserts.assertString(
this.strokeColor, 'strokeColor must be a string'); this.strokeColor, 'strokeColor must be a string');
} }
/** @type {number|undefined} */ /** @type {number|undefined} */
this.strokeWidth = config.strokeWidth; this.strokeWidth = options.strokeWidth;
if (goog.isDef(this.strokeWidth)) { if (goog.isDef(this.strokeWidth)) {
goog.asserts.assertNumber( goog.asserts.assertNumber(
this.strokeWidth, 'strokeWidth must be a number'); this.strokeWidth, 'strokeWidth must be a number');
@@ -51,9 +51,9 @@ ol.style.PolygonLiteral = function(config) {
(goog.isDef(this.strokeColor) && goog.isDef(this.strokeWidth)), (goog.isDef(this.strokeColor) && goog.isDef(this.strokeWidth)),
'Either fillColor or strokeColor and strokeWidth must be set'); 'Either fillColor or strokeColor and strokeWidth must be set');
goog.asserts.assertNumber(config.opacity, 'opacity must be a number'); goog.asserts.assertNumber(options.opacity, 'opacity must be a number');
/** @type {number} */ /** @type {number} */
this.opacity = config.opacity; this.opacity = options.opacity;
}; };
goog.inherits(ol.style.PolygonLiteral, ol.style.SymbolizerLiteral); goog.inherits(ol.style.PolygonLiteral, ol.style.SymbolizerLiteral);
@@ -74,7 +74,7 @@ ol.style.PolygonLiteral.prototype.equals = function(polygonLiteral) {
/** /**
* @constructor * @constructor
* @extends {ol.style.Symbolizer} * @extends {ol.style.Symbolizer}
* @param {ol.style.PolygonOptions} options Symbolizer properties. * @param {ol.style.PolygonOptions} options Polygon options.
*/ */
ol.style.Polygon = function(options) { ol.style.Polygon = function(options) {
goog.base(this); goog.base(this);
+14 -14
View File
@@ -32,33 +32,33 @@ ol.style.ShapeLiteralOptions;
/** /**
* @constructor * @constructor
* @extends {ol.style.PointLiteral} * @extends {ol.style.PointLiteral}
* @param {ol.style.ShapeLiteralOptions} config Symbolizer properties. * @param {ol.style.ShapeLiteralOptions} options Shape literal options.
*/ */
ol.style.ShapeLiteral = function(config) { ol.style.ShapeLiteral = function(options) {
goog.asserts.assertString(config.type, 'type must be a string'); goog.asserts.assertString(options.type, 'type must be a string');
/** @type {ol.style.ShapeType} */ /** @type {ol.style.ShapeType} */
this.type = config.type; this.type = options.type;
goog.asserts.assertNumber(config.size, 'size must be a number'); goog.asserts.assertNumber(options.size, 'size must be a number');
/** @type {number} */ /** @type {number} */
this.size = config.size; this.size = options.size;
/** @type {string|undefined} */ /** @type {string|undefined} */
this.fillColor = config.fillColor; this.fillColor = options.fillColor;
if (goog.isDef(config.fillColor)) { if (goog.isDef(options.fillColor)) {
goog.asserts.assertString(config.fillColor, 'fillColor must be a string'); goog.asserts.assertString(options.fillColor, 'fillColor must be a string');
} }
/** @type {string|undefined} */ /** @type {string|undefined} */
this.strokeColor = config.strokeColor; this.strokeColor = options.strokeColor;
if (goog.isDef(this.strokeColor)) { if (goog.isDef(this.strokeColor)) {
goog.asserts.assertString( goog.asserts.assertString(
this.strokeColor, 'strokeColor must be a string'); this.strokeColor, 'strokeColor must be a string');
} }
/** @type {number|undefined} */ /** @type {number|undefined} */
this.strokeWidth = config.strokeWidth; this.strokeWidth = options.strokeWidth;
if (goog.isDef(this.strokeWidth)) { if (goog.isDef(this.strokeWidth)) {
goog.asserts.assertNumber( goog.asserts.assertNumber(
this.strokeWidth, 'strokeWidth must be a number'); this.strokeWidth, 'strokeWidth must be a number');
@@ -69,9 +69,9 @@ ol.style.ShapeLiteral = function(config) {
(goog.isDef(this.strokeColor) && goog.isDef(this.strokeWidth)), (goog.isDef(this.strokeColor) && goog.isDef(this.strokeWidth)),
'Either fillColor or strokeColor and strokeWidth must be set'); 'Either fillColor or strokeColor and strokeWidth must be set');
goog.asserts.assertNumber(config.opacity, 'opacity must be a number'); goog.asserts.assertNumber(options.opacity, 'opacity must be a number');
/** @type {number} */ /** @type {number} */
this.opacity = config.opacity; this.opacity = options.opacity;
}; };
goog.inherits(ol.style.ShapeLiteral, ol.style.PointLiteral); goog.inherits(ol.style.ShapeLiteral, ol.style.PointLiteral);
@@ -94,7 +94,7 @@ ol.style.ShapeLiteral.prototype.equals = function(shapeLiteral) {
/** /**
* @constructor * @constructor
* @extends {ol.style.Point} * @extends {ol.style.Point}
* @param {ol.style.ShapeOptions} options Symbolizer properties. * @param {ol.style.ShapeOptions} options Shape options.
*/ */
ol.style.Shape = function(options) { ol.style.Shape = function(options) {