From dfc4dcc5f95f2de5bbd250591d462f1c851172c6 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Sat, 6 Apr 2013 19:26:02 +0200 Subject: [PATCH] Be more consistent with style options --- src/ol/style/icon.js | 16 ++++++++-------- src/ol/style/line.js | 20 +++++++++++--------- src/ol/style/polygon.js | 20 ++++++++++---------- src/ol/style/shape.js | 28 ++++++++++++++-------------- 4 files changed, 43 insertions(+), 41 deletions(-) diff --git a/src/ol/style/icon.js b/src/ol/style/icon.js index b390bb67aa..dce309eda4 100644 --- a/src/ol/style/icon.js +++ b/src/ol/style/icon.js @@ -23,24 +23,24 @@ ol.style.IconLiteralOptions; /** * @constructor * @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} */ - this.url = config.url; + this.url = options.url; /** @type {number|undefined} */ - this.width = config.width; + this.width = options.width; /** @type {number|undefined} */ - this.height = config.height; + this.height = options.height; /** @type {number} */ - this.opacity = config.opacity; + this.opacity = options.opacity; /** @type {number} */ - this.rotation = config.rotation; + this.rotation = options.rotation; }; goog.inherits(ol.style.IconLiteral, ol.style.PointLiteral); @@ -62,7 +62,7 @@ ol.style.IconLiteral.prototype.equals = function(iconLiteral) { /** * @constructor * @extends {ol.style.Point} - * @param {ol.style.IconOptions} options Symbolizer properties. + * @param {ol.style.IconOptions} options Icon options. */ ol.style.Icon = function(options) { diff --git a/src/ol/style/line.js b/src/ol/style/line.js index 1082396723..95460b8d45 100644 --- a/src/ol/style/line.js +++ b/src/ol/style/line.js @@ -20,22 +20,24 @@ ol.style.LineLiteralOptions; /** * @constructor * @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.asserts.assertString(config.strokeColor, 'strokeColor must be a string'); + goog.asserts.assertString( + options.strokeColor, 'strokeColor must be a 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} */ - 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} */ - this.opacity = config.opacity; + this.opacity = options.opacity; }; goog.inherits(ol.style.LineLiteral, ol.style.SymbolizerLiteral); @@ -55,7 +57,7 @@ ol.style.LineLiteral.prototype.equals = function(lineLiteral) { /** * @constructor * @extends {ol.style.Symbolizer} - * @param {ol.style.LineOptions} options Symbolizer properties. + * @param {ol.style.LineOptions} options Line options. */ ol.style.Line = function(options) { goog.base(this); diff --git a/src/ol/style/polygon.js b/src/ol/style/polygon.js index 4b0daa0813..b207a1ebec 100644 --- a/src/ol/style/polygon.js +++ b/src/ol/style/polygon.js @@ -21,26 +21,26 @@ ol.style.PolygonLiteralOptions; /** * @constructor * @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); /** @type {string|undefined} */ - this.fillColor = config.fillColor; - if (goog.isDef(config.fillColor)) { - goog.asserts.assertString(config.fillColor, 'fillColor must be a string'); + this.fillColor = options.fillColor; + if (goog.isDef(options.fillColor)) { + goog.asserts.assertString(options.fillColor, 'fillColor must be a string'); } /** @type {string|undefined} */ - this.strokeColor = config.strokeColor; + this.strokeColor = options.strokeColor; if (goog.isDef(this.strokeColor)) { goog.asserts.assertString( this.strokeColor, 'strokeColor must be a string'); } /** @type {number|undefined} */ - this.strokeWidth = config.strokeWidth; + this.strokeWidth = options.strokeWidth; if (goog.isDef(this.strokeWidth)) { goog.asserts.assertNumber( this.strokeWidth, 'strokeWidth must be a number'); @@ -51,9 +51,9 @@ ol.style.PolygonLiteral = function(config) { (goog.isDef(this.strokeColor) && goog.isDef(this.strokeWidth)), '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} */ - this.opacity = config.opacity; + this.opacity = options.opacity; }; goog.inherits(ol.style.PolygonLiteral, ol.style.SymbolizerLiteral); @@ -74,7 +74,7 @@ ol.style.PolygonLiteral.prototype.equals = function(polygonLiteral) { /** * @constructor * @extends {ol.style.Symbolizer} - * @param {ol.style.PolygonOptions} options Symbolizer properties. + * @param {ol.style.PolygonOptions} options Polygon options. */ ol.style.Polygon = function(options) { goog.base(this); diff --git a/src/ol/style/shape.js b/src/ol/style/shape.js index 754c90feb6..acc8a98f8d 100644 --- a/src/ol/style/shape.js +++ b/src/ol/style/shape.js @@ -32,33 +32,33 @@ ol.style.ShapeLiteralOptions; /** * @constructor * @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} */ - 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} */ - this.size = config.size; + this.size = options.size; /** @type {string|undefined} */ - this.fillColor = config.fillColor; - if (goog.isDef(config.fillColor)) { - goog.asserts.assertString(config.fillColor, 'fillColor must be a string'); + this.fillColor = options.fillColor; + if (goog.isDef(options.fillColor)) { + goog.asserts.assertString(options.fillColor, 'fillColor must be a string'); } /** @type {string|undefined} */ - this.strokeColor = config.strokeColor; + this.strokeColor = options.strokeColor; if (goog.isDef(this.strokeColor)) { goog.asserts.assertString( this.strokeColor, 'strokeColor must be a string'); } /** @type {number|undefined} */ - this.strokeWidth = config.strokeWidth; + this.strokeWidth = options.strokeWidth; if (goog.isDef(this.strokeWidth)) { goog.asserts.assertNumber( this.strokeWidth, 'strokeWidth must be a number'); @@ -69,9 +69,9 @@ ol.style.ShapeLiteral = function(config) { (goog.isDef(this.strokeColor) && goog.isDef(this.strokeWidth)), '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} */ - this.opacity = config.opacity; + this.opacity = options.opacity; }; goog.inherits(ol.style.ShapeLiteral, ol.style.PointLiteral); @@ -94,7 +94,7 @@ ol.style.ShapeLiteral.prototype.equals = function(shapeLiteral) { /** * @constructor * @extends {ol.style.Point} - * @param {ol.style.ShapeOptions} options Symbolizer properties. + * @param {ol.style.ShapeOptions} options Shape options. */ ol.style.Shape = function(options) {