diff --git a/src/ol/style/iconliteral.js b/src/ol/style/iconliteral.js new file mode 100644 index 0000000000..63dd49a812 --- /dev/null +++ b/src/ol/style/iconliteral.js @@ -0,0 +1,53 @@ +goog.provide('ol.style.IconLiteral'); +goog.provide('ol.style.IconType'); + +goog.require('ol.style.PointLiteral'); + + +/** + * @typedef {{url: (string), + * width: (number|undefined), + * height: (number|undefined), + * opacity: (number), + * rotation: (number)}} + */ +ol.style.IconLiteralOptions; + + + +/** + * @constructor + * @extends {ol.style.PointLiteral} + * @param {ol.style.IconLiteralOptions} options Icon literal options. + */ +ol.style.IconLiteral = function(options) { + + /** @type {string} */ + this.url = options.url; + + /** @type {number|undefined} */ + this.width = options.width; + + /** @type {number|undefined} */ + this.height = options.height; + + /** @type {number} */ + this.opacity = options.opacity; + + /** @type {number} */ + this.rotation = options.rotation; + +}; +goog.inherits(ol.style.IconLiteral, ol.style.PointLiteral); + + +/** + * @inheritDoc + */ +ol.style.IconLiteral.prototype.equals = function(iconLiteral) { + return this.url == iconLiteral.url && + this.width == iconLiteral.width && + this.height == iconLiteral.height && + this.opacity == iconLiteral.opacity && + this.rotation == iconLiteral.rotation; +}; diff --git a/src/ol/style/icon.js b/src/ol/style/iconsymbolizer.js similarity index 80% rename from src/ol/style/icon.js rename to src/ol/style/iconsymbolizer.js index 200517d373..b48564217a 100644 --- a/src/ol/style/icon.js +++ b/src/ol/style/iconsymbolizer.js @@ -1,64 +1,15 @@ goog.provide('ol.style.Icon'); -goog.provide('ol.style.IconLiteral'); -goog.provide('ol.style.IconType'); goog.require('goog.asserts'); goog.require('ol.expr'); goog.require('ol.expr.Expression'); goog.require('ol.expr.Literal'); +goog.require('ol.style.IconLiteral'); +goog.require('ol.style.IconType'); goog.require('ol.style.Point'); goog.require('ol.style.PointLiteral'); -/** - * @typedef {{url: (string), - * width: (number|undefined), - * height: (number|undefined), - * opacity: (number), - * rotation: (number)}} - */ -ol.style.IconLiteralOptions; - - - -/** - * @constructor - * @extends {ol.style.PointLiteral} - * @param {ol.style.IconLiteralOptions} options Icon literal options. - */ -ol.style.IconLiteral = function(options) { - - /** @type {string} */ - this.url = options.url; - - /** @type {number|undefined} */ - this.width = options.width; - - /** @type {number|undefined} */ - this.height = options.height; - - /** @type {number} */ - this.opacity = options.opacity; - - /** @type {number} */ - this.rotation = options.rotation; - -}; -goog.inherits(ol.style.IconLiteral, ol.style.PointLiteral); - - -/** - * @inheritDoc - */ -ol.style.IconLiteral.prototype.equals = function(iconLiteral) { - return this.url == iconLiteral.url && - this.width == iconLiteral.width && - this.height == iconLiteral.height && - this.opacity == iconLiteral.opacity && - this.rotation == iconLiteral.rotation; -}; - - /** * @constructor diff --git a/src/ol/style/lineliteral.js b/src/ol/style/lineliteral.js new file mode 100644 index 0000000000..d3435f756f --- /dev/null +++ b/src/ol/style/lineliteral.js @@ -0,0 +1,50 @@ +goog.provide('ol.style.LineLiteral'); + +goog.require('goog.asserts'); +goog.require('ol.style.Literal'); + + +/** + * @typedef {{strokeColor: (string), + * strokeOpacity: (number), + * strokeWidth: (number)}} + */ +ol.style.LineLiteralOptions; + + + +/** + * @constructor + * @extends {ol.style.Literal} + * @param {ol.style.LineLiteralOptions} options Line literal options. + */ +ol.style.LineLiteral = function(options) { + goog.base(this); + + goog.asserts.assertString( + options.strokeColor, 'strokeColor must be a string'); + /** @type {string} */ + this.strokeColor = options.strokeColor; + + goog.asserts.assertNumber( + options.strokeOpacity, 'strokeOpacity must be a number'); + /** @type {number} */ + this.strokeOpacity = options.strokeOpacity; + + goog.asserts.assertNumber( + options.strokeWidth, 'strokeWidth must be a number'); + /** @type {number} */ + this.strokeWidth = options.strokeWidth; + +}; +goog.inherits(ol.style.LineLiteral, ol.style.Literal); + + +/** + * @inheritDoc + */ +ol.style.LineLiteral.prototype.equals = function(lineLiteral) { + return this.strokeColor == lineLiteral.strokeColor && + this.strokeOpacity == lineLiteral.strokeOpacity && + this.strokeWidth == lineLiteral.strokeWidth; +}; diff --git a/src/ol/style/line.js b/src/ol/style/linesymbolizer.js similarity index 75% rename from src/ol/style/line.js rename to src/ol/style/linesymbolizer.js index e21042e484..daf9cfd660 100644 --- a/src/ol/style/line.js +++ b/src/ol/style/linesymbolizer.js @@ -1,60 +1,14 @@ goog.provide('ol.style.Line'); -goog.provide('ol.style.LineLiteral'); goog.require('goog.asserts'); goog.require('ol.expr'); goog.require('ol.expr.Expression'); goog.require('ol.expr.Literal'); +goog.require('ol.style.LineLiteral'); goog.require('ol.style.Symbolizer'); goog.require('ol.style.Literal'); -/** - * @typedef {{strokeColor: (string), - * strokeOpacity: (number), - * strokeWidth: (number)}} - */ -ol.style.LineLiteralOptions; - - - -/** - * @constructor - * @extends {ol.style.Literal} - * @param {ol.style.LineLiteralOptions} options Line literal options. - */ -ol.style.LineLiteral = function(options) { - goog.base(this); - - goog.asserts.assertString( - options.strokeColor, 'strokeColor must be a string'); - /** @type {string} */ - this.strokeColor = options.strokeColor; - - goog.asserts.assertNumber( - options.strokeOpacity, 'strokeOpacity must be a number'); - /** @type {number} */ - this.strokeOpacity = options.strokeOpacity; - - goog.asserts.assertNumber( - options.strokeWidth, 'strokeWidth must be a number'); - /** @type {number} */ - this.strokeWidth = options.strokeWidth; - -}; -goog.inherits(ol.style.LineLiteral, ol.style.Literal); - - -/** - * @inheritDoc - */ -ol.style.LineLiteral.prototype.equals = function(lineLiteral) { - return this.strokeColor == lineLiteral.strokeColor && - this.strokeOpacity == lineLiteral.strokeOpacity && - this.strokeWidth == lineLiteral.strokeWidth; -}; - - /** * @constructor diff --git a/src/ol/style/literal.js b/src/ol/style/literal.js new file mode 100644 index 0000000000..aac49eaec3 --- /dev/null +++ b/src/ol/style/literal.js @@ -0,0 +1,16 @@ +goog.provide('ol.style.Literal'); + + + +/** + * @constructor + */ +ol.style.Literal = function() {}; + + +/** + * @param {ol.style.Literal} symbolizerLiteral Symbolizer literal to + * compare to. + * @return {boolean} Is the passed symbolizer literal equal to this instance? + */ +ol.style.Literal.prototype.equals = goog.abstractMethod; diff --git a/src/ol/style/pointliteral.js b/src/ol/style/pointliteral.js new file mode 100644 index 0000000000..f456380577 --- /dev/null +++ b/src/ol/style/pointliteral.js @@ -0,0 +1,14 @@ +goog.provide('ol.style.PointLiteral'); + +goog.require('ol.style.Literal'); + + + +/** + * @constructor + * @extends {ol.style.Literal} + */ +ol.style.PointLiteral = function() { + goog.base(this); +}; +goog.inherits(ol.style.PointLiteral, ol.style.Literal); diff --git a/src/ol/style/point.js b/src/ol/style/pointsymbolizer.js similarity index 56% rename from src/ol/style/point.js rename to src/ol/style/pointsymbolizer.js index 147be51dfb..48fc7d7c7e 100644 --- a/src/ol/style/point.js +++ b/src/ol/style/pointsymbolizer.js @@ -1,19 +1,6 @@ goog.provide('ol.style.Point'); -goog.provide('ol.style.PointLiteral'); goog.require('ol.style.Symbolizer'); -goog.require('ol.style.Literal'); - - - -/** - * @constructor - * @extends {ol.style.Literal} - */ -ol.style.PointLiteral = function() { - goog.base(this); -}; -goog.inherits(ol.style.PointLiteral, ol.style.Literal); diff --git a/src/ol/style/polygonliteral.js b/src/ol/style/polygonliteral.js new file mode 100644 index 0000000000..88e7149421 --- /dev/null +++ b/src/ol/style/polygonliteral.js @@ -0,0 +1,82 @@ +goog.provide('ol.style.PolygonLiteral'); + +goog.require('goog.asserts'); +goog.require('ol.style.Literal'); + + +/** + * @typedef {{fillColor: (string|undefined), + * fillOpacity: (number|undefined), + * strokeColor: (string|undefined), + * strokeOpacity: (number|undefined), + * strokeWidth: (number|undefined)}} + */ +ol.style.PolygonLiteralOptions; + + + +/** + * @constructor + * @extends {ol.style.Literal} + * @param {ol.style.PolygonLiteralOptions} options Polygon literal options. + */ +ol.style.PolygonLiteral = function(options) { + goog.base(this); + + /** @type {string|undefined} */ + this.fillColor = options.fillColor; + if (goog.isDef(options.fillColor)) { + goog.asserts.assertString(options.fillColor, 'fillColor must be a string'); + } + + /** @type {number|undefined} */ + this.fillOpacity = options.fillOpacity; + if (goog.isDef(options.fillOpacity)) { + goog.asserts.assertNumber( + options.fillOpacity, 'fillOpacity must be a number'); + } + + /** @type {string|undefined} */ + this.strokeColor = options.strokeColor; + if (goog.isDef(this.strokeColor)) { + goog.asserts.assertString( + this.strokeColor, 'strokeColor must be a string'); + } + + /** @type {number|undefined} */ + this.strokeOpacity = options.strokeOpacity; + if (goog.isDef(this.strokeOpacity)) { + goog.asserts.assertNumber( + this.strokeOpacity, 'strokeOpacity must be a number'); + } + + /** @type {number|undefined} */ + this.strokeWidth = options.strokeWidth; + if (goog.isDef(this.strokeWidth)) { + goog.asserts.assertNumber( + this.strokeWidth, 'strokeWidth must be a number'); + } + + // fill and/or stroke properties must be defined + var fillDef = goog.isDef(this.fillColor) && goog.isDef(this.fillOpacity); + var strokeDef = goog.isDef(this.strokeColor) && + goog.isDef(this.strokeOpacity) && + goog.isDef(this.strokeWidth); + goog.asserts.assert(fillDef || strokeDef, + 'Either fillColor and fillOpacity or ' + + 'strokeColor and strokeOpacity and strokeWidth must be set'); + +}; +goog.inherits(ol.style.PolygonLiteral, ol.style.Literal); + + +/** + * @inheritDoc + */ +ol.style.PolygonLiteral.prototype.equals = function(polygonLiteral) { + return this.fillColor == polygonLiteral.fillColor && + this.fillOpacity == polygonLiteral.fillOpacity && + this.strokeColor == polygonLiteral.strokeColor && + this.strokeOpacity == polygonLiteral.strokeOpacity && + this.strokeWidth == polygonLiteral.strokeWidth; +}; diff --git a/src/ol/style/polygon.js b/src/ol/style/polygonsymbolizer.js similarity index 75% rename from src/ol/style/polygon.js rename to src/ol/style/polygonsymbolizer.js index 4e158fc45d..2e102d66ba 100644 --- a/src/ol/style/polygon.js +++ b/src/ol/style/polygonsymbolizer.js @@ -1,90 +1,11 @@ goog.provide('ol.style.Polygon'); -goog.provide('ol.style.PolygonLiteral'); goog.require('goog.asserts'); goog.require('ol.expr'); goog.require('ol.expr.Expression'); goog.require('ol.expr.Literal'); +goog.require('ol.style.PolygonLiteral'); goog.require('ol.style.Symbolizer'); -goog.require('ol.style.Literal'); - - -/** - * @typedef {{fillColor: (string|undefined), - * fillOpacity: (number|undefined), - * strokeColor: (string|undefined), - * strokeOpacity: (number|undefined), - * strokeWidth: (number|undefined)}} - */ -ol.style.PolygonLiteralOptions; - - - -/** - * @constructor - * @extends {ol.style.Literal} - * @param {ol.style.PolygonLiteralOptions} options Polygon literal options. - */ -ol.style.PolygonLiteral = function(options) { - goog.base(this); - - /** @type {string|undefined} */ - this.fillColor = options.fillColor; - if (goog.isDef(options.fillColor)) { - goog.asserts.assertString(options.fillColor, 'fillColor must be a string'); - } - - /** @type {number|undefined} */ - this.fillOpacity = options.fillOpacity; - if (goog.isDef(options.fillOpacity)) { - goog.asserts.assertNumber( - options.fillOpacity, 'fillOpacity must be a number'); - } - - /** @type {string|undefined} */ - this.strokeColor = options.strokeColor; - if (goog.isDef(this.strokeColor)) { - goog.asserts.assertString( - this.strokeColor, 'strokeColor must be a string'); - } - - /** @type {number|undefined} */ - this.strokeOpacity = options.strokeOpacity; - if (goog.isDef(this.strokeOpacity)) { - goog.asserts.assertNumber( - this.strokeOpacity, 'strokeOpacity must be a number'); - } - - /** @type {number|undefined} */ - this.strokeWidth = options.strokeWidth; - if (goog.isDef(this.strokeWidth)) { - goog.asserts.assertNumber( - this.strokeWidth, 'strokeWidth must be a number'); - } - - // fill and/or stroke properties must be defined - var fillDef = goog.isDef(this.fillColor) && goog.isDef(this.fillOpacity); - var strokeDef = goog.isDef(this.strokeColor) && - goog.isDef(this.strokeOpacity) && - goog.isDef(this.strokeWidth); - goog.asserts.assert(fillDef || strokeDef, - 'Either fillColor and fillOpacity or ' + - 'strokeColor and strokeOpacity and strokeWidth must be set'); - -}; -goog.inherits(ol.style.PolygonLiteral, ol.style.Literal); - - -/** - * @inheritDoc - */ -ol.style.PolygonLiteral.prototype.equals = function(polygonLiteral) { - return this.fillColor == polygonLiteral.fillColor && - this.fillOpacity == polygonLiteral.fillOpacity && - this.strokeColor == polygonLiteral.strokeColor && - this.strokeOpacity == polygonLiteral.strokeOpacity && - this.strokeWidth == polygonLiteral.strokeWidth; -}; diff --git a/src/ol/style/shapeliteral.js b/src/ol/style/shapeliteral.js new file mode 100644 index 0000000000..953f9d89f9 --- /dev/null +++ b/src/ol/style/shapeliteral.js @@ -0,0 +1,102 @@ +goog.provide('ol.style.ShapeLiteral'); +goog.provide('ol.style.ShapeType'); + +goog.require('goog.asserts'); +goog.require('ol.style.PointLiteral'); + + +/** + * @enum {string} + */ +ol.style.ShapeType = { + CIRCLE: 'circle' +}; + + +/** + * @typedef {{type: (ol.style.ShapeType), + * size: (number), + * fillColor: (string|undefined), + * fillOpacity: (number|undefined), + * strokeColor: (string|undefined), + * strokeOpacity: (number|undefined), + * strokeWidth: (number|undefined)}} + */ +ol.style.ShapeLiteralOptions; + + + +/** + * @constructor + * @extends {ol.style.PointLiteral} + * @param {ol.style.ShapeLiteralOptions} options Shape literal options. + */ +ol.style.ShapeLiteral = function(options) { + + goog.asserts.assertString(options.type, 'type must be a string'); + /** @type {ol.style.ShapeType} */ + this.type = options.type; + + goog.asserts.assertNumber(options.size, 'size must be a number'); + /** @type {number} */ + this.size = options.size; + + /** @type {string|undefined} */ + this.fillColor = options.fillColor; + if (goog.isDef(options.fillColor)) { + goog.asserts.assertString(options.fillColor, 'fillColor must be a string'); + } + + /** @type {number|undefined} */ + this.fillOpacity = options.fillOpacity; + if (goog.isDef(options.fillOpacity)) { + goog.asserts.assertNumber( + options.fillOpacity, 'fillOpacity must be a number'); + } + + /** @type {string|undefined} */ + this.strokeColor = options.strokeColor; + if (goog.isDef(this.strokeColor)) { + goog.asserts.assertString( + this.strokeColor, 'strokeColor must be a string'); + } + + /** @type {number|undefined} */ + this.strokeOpacity = options.strokeOpacity; + if (goog.isDef(this.strokeOpacity)) { + goog.asserts.assertNumber( + this.strokeOpacity, 'strokeOpacity must be a number'); + } + + /** @type {number|undefined} */ + this.strokeWidth = options.strokeWidth; + if (goog.isDef(this.strokeWidth)) { + goog.asserts.assertNumber( + this.strokeWidth, 'strokeWidth must be a number'); + } + + // fill and/or stroke properties must be defined + var fillDef = goog.isDef(this.fillColor) && goog.isDef(this.fillOpacity); + var strokeDef = goog.isDef(this.strokeColor) && + goog.isDef(this.strokeOpacity) && + goog.isDef(this.strokeWidth); + goog.asserts.assert(fillDef || strokeDef, + 'Either fillColor and fillOpacity or ' + + 'strokeColor and strokeOpacity and strokeWidth must be set'); + +}; +goog.inherits(ol.style.ShapeLiteral, ol.style.PointLiteral); + + +/** + * @inheritDoc + */ +ol.style.ShapeLiteral.prototype.equals = function(shapeLiteral) { + return this.type == shapeLiteral.type && + this.size == shapeLiteral.size && + this.fillColor == shapeLiteral.fillColor && + this.fillOpacity == shapeLiteral.fillOpacity && + this.strokeColor == shapeLiteral.strokeColor && + this.strokeOpacity == shapeLiteral.strokeOpacity && + this.strokeWidth == shapeLiteral.strokeWidth; +}; diff --git a/src/ol/style/shape.js b/src/ol/style/shapesymbolizer.js similarity index 75% rename from src/ol/style/shape.js rename to src/ol/style/shapesymbolizer.js index dc9b1ead07..2080cd72fa 100644 --- a/src/ol/style/shape.js +++ b/src/ol/style/shapesymbolizer.js @@ -1,6 +1,4 @@ goog.provide('ol.style.Shape'); -goog.provide('ol.style.ShapeLiteral'); -goog.provide('ol.style.ShapeType'); goog.require('goog.asserts'); goog.require('ol.expr'); @@ -8,103 +6,8 @@ goog.require('ol.expr.Expression'); goog.require('ol.expr.Literal'); goog.require('ol.style.Point'); goog.require('ol.style.PointLiteral'); - - -/** - * @enum {string} - */ -ol.style.ShapeType = { - CIRCLE: 'circle' -}; - - -/** - * @typedef {{type: (ol.style.ShapeType), - * size: (number), - * fillColor: (string|undefined), - * fillOpacity: (number|undefined), - * strokeColor: (string|undefined), - * strokeOpacity: (number|undefined), - * strokeWidth: (number|undefined)}} - */ -ol.style.ShapeLiteralOptions; - - - -/** - * @constructor - * @extends {ol.style.PointLiteral} - * @param {ol.style.ShapeLiteralOptions} options Shape literal options. - */ -ol.style.ShapeLiteral = function(options) { - - goog.asserts.assertString(options.type, 'type must be a string'); - /** @type {ol.style.ShapeType} */ - this.type = options.type; - - goog.asserts.assertNumber(options.size, 'size must be a number'); - /** @type {number} */ - this.size = options.size; - - /** @type {string|undefined} */ - this.fillColor = options.fillColor; - if (goog.isDef(options.fillColor)) { - goog.asserts.assertString(options.fillColor, 'fillColor must be a string'); - } - - /** @type {number|undefined} */ - this.fillOpacity = options.fillOpacity; - if (goog.isDef(options.fillOpacity)) { - goog.asserts.assertNumber( - options.fillOpacity, 'fillOpacity must be a number'); - } - - /** @type {string|undefined} */ - this.strokeColor = options.strokeColor; - if (goog.isDef(this.strokeColor)) { - goog.asserts.assertString( - this.strokeColor, 'strokeColor must be a string'); - } - - /** @type {number|undefined} */ - this.strokeOpacity = options.strokeOpacity; - if (goog.isDef(this.strokeOpacity)) { - goog.asserts.assertNumber( - this.strokeOpacity, 'strokeOpacity must be a number'); - } - - /** @type {number|undefined} */ - this.strokeWidth = options.strokeWidth; - if (goog.isDef(this.strokeWidth)) { - goog.asserts.assertNumber( - this.strokeWidth, 'strokeWidth must be a number'); - } - - // fill and/or stroke properties must be defined - var fillDef = goog.isDef(this.fillColor) && goog.isDef(this.fillOpacity); - var strokeDef = goog.isDef(this.strokeColor) && - goog.isDef(this.strokeOpacity) && - goog.isDef(this.strokeWidth); - goog.asserts.assert(fillDef || strokeDef, - 'Either fillColor and fillOpacity or ' + - 'strokeColor and strokeOpacity and strokeWidth must be set'); - -}; -goog.inherits(ol.style.ShapeLiteral, ol.style.PointLiteral); - - -/** - * @inheritDoc - */ -ol.style.ShapeLiteral.prototype.equals = function(shapeLiteral) { - return this.type == shapeLiteral.type && - this.size == shapeLiteral.size && - this.fillColor == shapeLiteral.fillColor && - this.fillOpacity == shapeLiteral.fillOpacity && - this.strokeColor == shapeLiteral.strokeColor && - this.strokeOpacity == shapeLiteral.strokeOpacity && - this.strokeWidth == shapeLiteral.strokeWidth; -}; +goog.require('ol.style.ShapeLiteral'); +goog.require('ol.style.ShapeType'); diff --git a/src/ol/style/symbolizer.js b/src/ol/style/symbolizer.js index e8ae6fbe9b..d599dbb2c2 100644 --- a/src/ol/style/symbolizer.js +++ b/src/ol/style/symbolizer.js @@ -1,22 +1,7 @@ goog.provide('ol.style.Symbolizer'); -goog.provide('ol.style.Literal'); goog.require('ol.Feature'); - - - -/** - * @constructor - */ -ol.style.Literal = function() {}; - - -/** - * @param {ol.style.Literal} symbolizerLiteral Symbolizer literal to - * compare to. - * @return {boolean} Is the passed symbolizer literal equal to this instance? - */ -ol.style.Literal.prototype.equals = goog.abstractMethod; +goog.require('ol.style.Literal'); diff --git a/src/ol/style/textliteral.js b/src/ol/style/textliteral.js new file mode 100644 index 0000000000..f61e06576b --- /dev/null +++ b/src/ol/style/textliteral.js @@ -0,0 +1,57 @@ +goog.provide('ol.style.TextLiteral'); + +goog.require('goog.asserts'); +goog.require('ol.style.Literal'); + + +/** + * @typedef {{color: string, + * fontFamily: string, + * fontSize: number, + * text: string, + * opacity: number}} + */ +ol.style.TextLiteralOptions; + + + +/** + * @constructor + * @extends {ol.style.Literal} + * @param {ol.style.TextLiteralOptions} options Text literal options. + */ +ol.style.TextLiteral = function(options) { + + goog.asserts.assertString(options.color, 'color must be a string'); + /** @type {string} */ + this.color = options.color; + + goog.asserts.assertString(options.fontFamily, 'fontFamily must be a string'); + /** @type {string} */ + this.fontFamily = options.fontFamily; + + goog.asserts.assertNumber(options.fontSize, 'fontSize must be a number'); + /** @type {number} */ + this.fontSize = options.fontSize; + + goog.asserts.assertString(options.text, 'text must be a string'); + /** @type {string} */ + this.text = options.text; + + goog.asserts.assertNumber(options.opacity, 'opacity must be a number'); + /** @type {number} */ + this.opacity = options.opacity; + +}; +goog.inherits(ol.style.TextLiteral, ol.style.Literal); + + +/** + * @inheritDoc + */ +ol.style.TextLiteral.prototype.equals = function(textLiteral) { + return this.color == textLiteral.color && + this.fontFamily == textLiteral.fontFamily && + this.fontSize == textLiteral.fontSize && + this.opacity == textLiteral.opacity; +}; diff --git a/src/ol/style/text.js b/src/ol/style/textsymbolizer.js similarity index 76% rename from src/ol/style/text.js rename to src/ol/style/textsymbolizer.js index 63c9951e76..68cea7c2b2 100644 --- a/src/ol/style/text.js +++ b/src/ol/style/textsymbolizer.js @@ -1,65 +1,11 @@ goog.provide('ol.style.Text'); -goog.provide('ol.style.TextLiteral'); goog.require('goog.asserts'); goog.require('ol.expr'); goog.require('ol.expr.Expression'); goog.require('ol.expr.Literal'); goog.require('ol.style.Symbolizer'); -goog.require('ol.style.Literal'); - - -/** - * @typedef {{color: string, - * fontFamily: string, - * fontSize: number, - * text: string, - * opacity: number}} - */ -ol.style.TextLiteralOptions; - - - -/** - * @constructor - * @extends {ol.style.Literal} - * @param {ol.style.TextLiteralOptions} options Text literal options. - */ -ol.style.TextLiteral = function(options) { - - goog.asserts.assertString(options.color, 'color must be a string'); - /** @type {string} */ - this.color = options.color; - - goog.asserts.assertString(options.fontFamily, 'fontFamily must be a string'); - /** @type {string} */ - this.fontFamily = options.fontFamily; - - goog.asserts.assertNumber(options.fontSize, 'fontSize must be a number'); - /** @type {number} */ - this.fontSize = options.fontSize; - - goog.asserts.assertString(options.text, 'text must be a string'); - /** @type {string} */ - this.text = options.text; - - goog.asserts.assertNumber(options.opacity, 'opacity must be a number'); - /** @type {number} */ - this.opacity = options.opacity; - -}; -goog.inherits(ol.style.TextLiteral, ol.style.Literal); - - -/** - * @inheritDoc - */ -ol.style.TextLiteral.prototype.equals = function(textLiteral) { - return this.color == textLiteral.color && - this.fontFamily == textLiteral.fontFamily && - this.fontSize == textLiteral.fontSize && - this.opacity == textLiteral.opacity; -}; +goog.require('ol.style.TextLiteral'); diff --git a/test/spec/ol/style/iconliteral.test.js b/test/spec/ol/style/iconliteral.test.js new file mode 100644 index 0000000000..8b7c4f9fef --- /dev/null +++ b/test/spec/ol/style/iconliteral.test.js @@ -0,0 +1,71 @@ +goog.provide('ol.test.style.IconLiteral'); + +describe('ol.style.IconLiteral', function() { + + describe('#equals()', function() { + + it('identifies equal literals', function() { + var literal = new ol.style.IconLiteral({ + height: 10, + width: 20, + opacity: 1, + rotation: 0.1, + url: 'http://example.com/1.png' + }); + var equalLiteral = new ol.style.IconLiteral({ + height: 10, + width: 20, + opacity: 1, + rotation: 0.1, + url: 'http://example.com/1.png' + }); + var differentLiteral1 = new ol.style.IconLiteral({ + height: 11, + width: 20, + opacity: 1, + rotation: 0.1, + url: 'http://example.com/1.png' + }); + var differentLiteral2 = new ol.style.IconLiteral({ + height: 10, + width: 2, + opacity: 1, + rotation: 0.1, + url: 'http://example.com/1.png' + }); + var differentLiteral3 = new ol.style.IconLiteral({ + height: 10, + width: 20, + opacity: 0.5, + rotation: 0.1, + url: 'http://example.com/1.png' + }); + var differentLiteral4 = new ol.style.IconLiteral({ + height: 10, + width: 20, + opacity: 1, + rotation: 0.2, + url: 'http://example.com/1.png' + }); + var differentLiteral5 = new ol.style.IconLiteral({ + height: 10, + width: 20, + opacity: 1, + rotation: 0.1, + url: 'http://example.com/2.png' + }); + expect(literal.equals(equalLiteral)).to.be(true); + expect(literal.equals(differentLiteral1)).to.be(false); + expect(literal.equals(differentLiteral2)).to.be(false); + expect(literal.equals(differentLiteral3)).to.be(false); + expect(literal.equals(differentLiteral4)).to.be(false); + expect(literal.equals(differentLiteral5)).to.be(false); + }); + + }); + +}); + + + +goog.require('ol.style.IconLiteral'); diff --git a/test/spec/ol/style/icon.test.js b/test/spec/ol/style/iconsymbolizer.test.js similarity index 82% rename from test/spec/ol/style/icon.test.js rename to test/spec/ol/style/iconsymbolizer.test.js index a697f53b47..eb9d646f93 100644 --- a/test/spec/ol/style/icon.test.js +++ b/test/spec/ol/style/iconsymbolizer.test.js @@ -1,71 +1,5 @@ goog.provide('ol.test.style.Icon'); -describe('ol.style.IconLiteral', function() { - - describe('#equals()', function() { - - it('identifies equal literals', function() { - var literal = new ol.style.IconLiteral({ - height: 10, - width: 20, - opacity: 1, - rotation: 0.1, - url: 'http://example.com/1.png' - }); - var equalLiteral = new ol.style.IconLiteral({ - height: 10, - width: 20, - opacity: 1, - rotation: 0.1, - url: 'http://example.com/1.png' - }); - var differentLiteral1 = new ol.style.IconLiteral({ - height: 11, - width: 20, - opacity: 1, - rotation: 0.1, - url: 'http://example.com/1.png' - }); - var differentLiteral2 = new ol.style.IconLiteral({ - height: 10, - width: 2, - opacity: 1, - rotation: 0.1, - url: 'http://example.com/1.png' - }); - var differentLiteral3 = new ol.style.IconLiteral({ - height: 10, - width: 20, - opacity: 0.5, - rotation: 0.1, - url: 'http://example.com/1.png' - }); - var differentLiteral4 = new ol.style.IconLiteral({ - height: 10, - width: 20, - opacity: 1, - rotation: 0.2, - url: 'http://example.com/1.png' - }); - var differentLiteral5 = new ol.style.IconLiteral({ - height: 10, - width: 20, - opacity: 1, - rotation: 0.1, - url: 'http://example.com/2.png' - }); - expect(literal.equals(equalLiteral)).to.be(true); - expect(literal.equals(differentLiteral1)).to.be(false); - expect(literal.equals(differentLiteral2)).to.be(false); - expect(literal.equals(differentLiteral3)).to.be(false); - expect(literal.equals(differentLiteral4)).to.be(false); - expect(literal.equals(differentLiteral5)).to.be(false); - }); - - }); - -}); - describe('ol.style.Icon', function() { describe('constructor', function() { diff --git a/test/spec/ol/style/lineliteral.test.js b/test/spec/ol/style/lineliteral.test.js new file mode 100644 index 0000000000..1813a5bb97 --- /dev/null +++ b/test/spec/ol/style/lineliteral.test.js @@ -0,0 +1,31 @@ +goog.provide('ol.test.style.LineLiteral'); + +describe('ol.style.LineLiteral', function() { + + describe('#equals()', function() { + + it('identifies equal literals', function() { + var literal = new ol.style.LineLiteral({ + strokeWidth: 3, + strokeColor: '#BADA55', + strokeOpacity: 1 + }); + var equalLiteral = new ol.style.LineLiteral({ + strokeColor: '#BADA55', + strokeWidth: 3, + strokeOpacity: 1 + }); + var differentLiteral = new ol.style.LineLiteral({ + strokeColor: '#013', + strokeWidth: 3, + strokeOpacity: 1 + }); + expect(literal.equals(equalLiteral)).to.be(true); + expect(literal.equals(differentLiteral)).to.be(false); + }); + + }); + +}); + +goog.require('ol.style.LineLiteral'); diff --git a/test/spec/ol/style/line.test.js b/test/spec/ol/style/linesymbolizer.test.js similarity index 86% rename from test/spec/ol/style/line.test.js rename to test/spec/ol/style/linesymbolizer.test.js index f5b7a1fb4b..d357f1ee13 100644 --- a/test/spec/ol/style/line.test.js +++ b/test/spec/ol/style/linesymbolizer.test.js @@ -1,33 +1,5 @@ goog.provide('ol.test.style.Line'); -describe('ol.style.LineLiteral', function() { - - describe('#equals()', function() { - - it('identifies equal literals', function() { - var literal = new ol.style.LineLiteral({ - strokeWidth: 3, - strokeColor: '#BADA55', - strokeOpacity: 1 - }); - var equalLiteral = new ol.style.LineLiteral({ - strokeColor: '#BADA55', - strokeWidth: 3, - strokeOpacity: 1 - }); - var differentLiteral = new ol.style.LineLiteral({ - strokeColor: '#013', - strokeWidth: 3, - strokeOpacity: 1 - }); - expect(literal.equals(equalLiteral)).to.be(true); - expect(literal.equals(differentLiteral)).to.be(false); - }); - - }); - -}); - describe('ol.style.Line', function() { describe('constructor', function() { diff --git a/test/spec/ol/style/polygonliteral.test.js b/test/spec/ol/style/polygonliteral.test.js new file mode 100644 index 0000000000..78805610ac --- /dev/null +++ b/test/spec/ol/style/polygonliteral.test.js @@ -0,0 +1,70 @@ +goog.provide('ol.test.style.PolygonLiteral'); + +describe('ol.style.PolygonLiteral', function() { + + describe('#equals()', function() { + + it('identifies equal literals', function() { + var literal = new ol.style.PolygonLiteral({ + strokeWidth: 3, + strokeColor: '#013', + strokeOpacity: 0.4, + fillColor: '#BADA55', + fillOpacity: 0.3 + }); + var equalLiteral = new ol.style.PolygonLiteral({ + strokeWidth: 3, + strokeColor: '#013', + strokeOpacity: 0.4, + fillColor: '#BADA55', + fillOpacity: 0.3 + }); + var differentStrokeWidth = new ol.style.PolygonLiteral({ + strokeWidth: 5, + strokeColor: '#013', + strokeOpacity: 0.4, + fillColor: '#BADA55', + fillOpacity: 0.3 + }); + var differentStrokeColor = new ol.style.PolygonLiteral({ + strokeWidth: 3, + strokeColor: '#ffff00', + strokeOpacity: 0.4, + fillColor: '#BADA55', + fillOpacity: 0.3 + }); + var differentStrokeOpacity = new ol.style.PolygonLiteral({ + strokeWidth: 3, + strokeColor: '#013', + strokeOpacity: 0.41, + fillColor: '#BADA55', + fillOpacity: 0.3 + }); + var differentFillColor = new ol.style.PolygonLiteral({ + strokeWidth: 3, + strokeColor: '#013', + strokeOpacity: 0.4, + fillColor: '#00ffff', + fillOpacity: 0.3 + }); + var differentFillOpacity = new ol.style.PolygonLiteral({ + strokeWidth: 3, + strokeColor: '#013', + strokeOpacity: 0.4, + fillColor: '#BADA55', + fillOpacity: 0.31 + }); + expect(literal.equals(equalLiteral)).to.be(true); + expect(literal.equals(differentStrokeWidth)).to.be(false); + expect(literal.equals(differentStrokeColor)).to.be(false); + expect(literal.equals(differentStrokeOpacity)).to.be(false); + expect(literal.equals(differentFillColor)).to.be(false); + expect(literal.equals(differentFillOpacity)).to.be(false); + }); + + }); + +}); + + +goog.require('ol.style.PolygonLiteral'); diff --git a/test/spec/ol/style/polygon.test.js b/test/spec/ol/style/polygonsymbolizer.test.js similarity index 77% rename from test/spec/ol/style/polygon.test.js rename to test/spec/ol/style/polygonsymbolizer.test.js index f8cf968929..2aebfa612e 100644 --- a/test/spec/ol/style/polygon.test.js +++ b/test/spec/ol/style/polygonsymbolizer.test.js @@ -1,71 +1,5 @@ goog.provide('ol.test.style.Polygon'); -describe('ol.style.PolygonLiteral', function() { - - describe('#equals()', function() { - - it('identifies equal literals', function() { - var literal = new ol.style.PolygonLiteral({ - strokeWidth: 3, - strokeColor: '#013', - strokeOpacity: 0.4, - fillColor: '#BADA55', - fillOpacity: 0.3 - }); - var equalLiteral = new ol.style.PolygonLiteral({ - strokeWidth: 3, - strokeColor: '#013', - strokeOpacity: 0.4, - fillColor: '#BADA55', - fillOpacity: 0.3 - }); - var differentStrokeWidth = new ol.style.PolygonLiteral({ - strokeWidth: 5, - strokeColor: '#013', - strokeOpacity: 0.4, - fillColor: '#BADA55', - fillOpacity: 0.3 - }); - var differentStrokeColor = new ol.style.PolygonLiteral({ - strokeWidth: 3, - strokeColor: '#ffff00', - strokeOpacity: 0.4, - fillColor: '#BADA55', - fillOpacity: 0.3 - }); - var differentStrokeOpacity = new ol.style.PolygonLiteral({ - strokeWidth: 3, - strokeColor: '#013', - strokeOpacity: 0.41, - fillColor: '#BADA55', - fillOpacity: 0.3 - }); - var differentFillColor = new ol.style.PolygonLiteral({ - strokeWidth: 3, - strokeColor: '#013', - strokeOpacity: 0.4, - fillColor: '#00ffff', - fillOpacity: 0.3 - }); - var differentFillOpacity = new ol.style.PolygonLiteral({ - strokeWidth: 3, - strokeColor: '#013', - strokeOpacity: 0.4, - fillColor: '#BADA55', - fillOpacity: 0.31 - }); - expect(literal.equals(equalLiteral)).to.be(true); - expect(literal.equals(differentStrokeWidth)).to.be(false); - expect(literal.equals(differentStrokeColor)).to.be(false); - expect(literal.equals(differentStrokeOpacity)).to.be(false); - expect(literal.equals(differentFillColor)).to.be(false); - expect(literal.equals(differentFillOpacity)).to.be(false); - }); - - }); - -}); - describe('ol.style.Polygon', function() { describe('constructor', function() { diff --git a/test/spec/ol/style/shapeliteral.test.js b/test/spec/ol/style/shapeliteral.test.js new file mode 100644 index 0000000000..20fa315909 --- /dev/null +++ b/test/spec/ol/style/shapeliteral.test.js @@ -0,0 +1,93 @@ +goog.provide('ol.test.style.ShapeLiteral'); + +describe('ol.style.ShapeLiteral', function() { + + describe('#equals()', function() { + + it('identifies equal literals', function() { + var literal = new ol.style.ShapeLiteral({ + type: ol.style.ShapeType.CIRCLE, + size: 4, + fillColor: '#BADA55', + fillOpacity: 0.9, + strokeColor: '#013', + strokeOpacity: 0.8, + strokeWidth: 3 + }); + var equalLiteral = new ol.style.ShapeLiteral({ + type: ol.style.ShapeType.CIRCLE, + size: 4, + fillColor: '#BADA55', + fillOpacity: 0.9, + strokeColor: '#013', + strokeOpacity: 0.8, + strokeWidth: 3 + }); + var differentSize = new ol.style.ShapeLiteral({ + type: ol.style.ShapeType.CIRCLE, + size: 5, + fillColor: '#BADA55', + fillOpacity: 0.9, + strokeColor: '#013', + strokeOpacity: 0.8, + strokeWidth: 3 + }); + var differentFillColor = new ol.style.ShapeLiteral({ + type: ol.style.ShapeType.CIRCLE, + size: 4, + fillColor: '#ffffff', + fillOpacity: 0.9, + strokeColor: '#013', + strokeOpacity: 0.8, + strokeWidth: 3 + }); + var differentFillOpacity = new ol.style.ShapeLiteral({ + type: ol.style.ShapeType.CIRCLE, + size: 4, + fillColor: '#BADA55', + fillOpacity: 0.8, + strokeColor: '#013', + strokeOpacity: 0.8, + strokeWidth: 3 + }); + var differentStrokeColor = new ol.style.ShapeLiteral({ + type: ol.style.ShapeType.CIRCLE, + size: 4, + fillColor: '#BADA55', + fillOpacity: 0.9, + strokeColor: '#ffffff', + strokeOpacity: 0.8, + strokeWidth: 3 + }); + var differentStrokeOpacity = new ol.style.ShapeLiteral({ + type: ol.style.ShapeType.CIRCLE, + size: 4, + fillColor: '#BADA55', + fillOpacity: 0.9, + strokeColor: '#013', + strokeOpacity: 0.7, + strokeWidth: 3 + }); + var differentStrokeWidth = new ol.style.ShapeLiteral({ + type: ol.style.ShapeType.CIRCLE, + size: 4, + fillColor: '#BADA55', + fillOpacity: 0.9, + strokeColor: '#013', + strokeOpacity: 0.8, + strokeWidth: 4 + }); + expect(literal.equals(equalLiteral)).to.be(true); + expect(literal.equals(differentSize)).to.be(false); + expect(literal.equals(differentFillColor)).to.be(false); + expect(literal.equals(differentFillOpacity)).to.be(false); + expect(literal.equals(differentStrokeColor)).to.be(false); + expect(literal.equals(differentStrokeOpacity)).to.be(false); + expect(literal.equals(differentStrokeWidth)).to.be(false); + }); + + }); + +}); + +goog.require('ol.style.ShapeLiteral'); diff --git a/test/spec/ol/style/shape.test.js b/test/spec/ol/style/shapesymbolizer.test.js similarity index 76% rename from test/spec/ol/style/shape.test.js rename to test/spec/ol/style/shapesymbolizer.test.js index 8c0c396e1c..32426d91a3 100644 --- a/test/spec/ol/style/shape.test.js +++ b/test/spec/ol/style/shapesymbolizer.test.js @@ -1,95 +1,5 @@ goog.provide('ol.test.style.Shape'); -describe('ol.style.ShapeLiteral', function() { - - describe('#equals()', function() { - - it('identifies equal literals', function() { - var literal = new ol.style.ShapeLiteral({ - type: ol.style.ShapeType.CIRCLE, - size: 4, - fillColor: '#BADA55', - fillOpacity: 0.9, - strokeColor: '#013', - strokeOpacity: 0.8, - strokeWidth: 3 - }); - var equalLiteral = new ol.style.ShapeLiteral({ - type: ol.style.ShapeType.CIRCLE, - size: 4, - fillColor: '#BADA55', - fillOpacity: 0.9, - strokeColor: '#013', - strokeOpacity: 0.8, - strokeWidth: 3 - }); - var differentSize = new ol.style.ShapeLiteral({ - type: ol.style.ShapeType.CIRCLE, - size: 5, - fillColor: '#BADA55', - fillOpacity: 0.9, - strokeColor: '#013', - strokeOpacity: 0.8, - strokeWidth: 3 - }); - var differentFillColor = new ol.style.ShapeLiteral({ - type: ol.style.ShapeType.CIRCLE, - size: 4, - fillColor: '#ffffff', - fillOpacity: 0.9, - strokeColor: '#013', - strokeOpacity: 0.8, - strokeWidth: 3 - }); - var differentFillOpacity = new ol.style.ShapeLiteral({ - type: ol.style.ShapeType.CIRCLE, - size: 4, - fillColor: '#BADA55', - fillOpacity: 0.8, - strokeColor: '#013', - strokeOpacity: 0.8, - strokeWidth: 3 - }); - var differentStrokeColor = new ol.style.ShapeLiteral({ - type: ol.style.ShapeType.CIRCLE, - size: 4, - fillColor: '#BADA55', - fillOpacity: 0.9, - strokeColor: '#ffffff', - strokeOpacity: 0.8, - strokeWidth: 3 - }); - var differentStrokeOpacity = new ol.style.ShapeLiteral({ - type: ol.style.ShapeType.CIRCLE, - size: 4, - fillColor: '#BADA55', - fillOpacity: 0.9, - strokeColor: '#013', - strokeOpacity: 0.7, - strokeWidth: 3 - }); - var differentStrokeWidth = new ol.style.ShapeLiteral({ - type: ol.style.ShapeType.CIRCLE, - size: 4, - fillColor: '#BADA55', - fillOpacity: 0.9, - strokeColor: '#013', - strokeOpacity: 0.8, - strokeWidth: 4 - }); - expect(literal.equals(equalLiteral)).to.be(true); - expect(literal.equals(differentSize)).to.be(false); - expect(literal.equals(differentFillColor)).to.be(false); - expect(literal.equals(differentFillOpacity)).to.be(false); - expect(literal.equals(differentStrokeColor)).to.be(false); - expect(literal.equals(differentStrokeOpacity)).to.be(false); - expect(literal.equals(differentStrokeWidth)).to.be(false); - }); - - }); - -}); - describe('ol.style.Shape', function() { describe('constructor', function() { diff --git a/test/spec/ol/style/textliteral.test.js b/test/spec/ol/style/textliteral.test.js new file mode 100644 index 0000000000..e06320e46d --- /dev/null +++ b/test/spec/ol/style/textliteral.test.js @@ -0,0 +1,69 @@ +goog.provide('ol.test.style.TextLiteral'); + +describe('ol.style.TextLiteral', function() { + + describe('#equals()', function() { + + it('identifies equal literals', function() { + var literal = new ol.style.TextLiteral({ + color: '#ff0000', + fontFamily: 'Arial', + fontSize: 11, + text: 'Test', + opacity: 0.5 + }); + var equalLiteral = new ol.style.TextLiteral({ + color: '#ff0000', + fontFamily: 'Arial', + fontSize: 11, + text: 'Test', + opacity: 0.5 + }); + var differentLiteral1 = new ol.style.TextLiteral({ + color: '#0000ff', + fontFamily: 'Arial', + fontSize: 11, + text: 'Test', + opacity: 0.5 + }); + var differentLiteral2 = new ol.style.TextLiteral({ + color: '#ff0000', + fontFamily: 'Dingbats', + fontSize: 11, + text: 'Test', + opacity: 0.5 + }); + var differentLiteral3 = new ol.style.TextLiteral({ + color: '#ff0000', + fontFamily: 'Arial', + fontSize: 12, + text: 'Test', + opacity: 0.5 + }); + var differentLiteral4 = new ol.style.TextLiteral({ + color: '#ff0000', + fontFamily: 'Arial', + fontSize: 11, + text: 'Test', + opacity: 0.6 + }); + var equalLiteral2 = new ol.style.TextLiteral({ + color: '#ff0000', + fontFamily: 'Arial', + fontSize: 11, + text: 'Text is not compared for equality', + opacity: 0.5 + }); + expect(literal.equals(equalLiteral)).to.be(true); + expect(literal.equals(differentLiteral1)).to.be(false); + expect(literal.equals(differentLiteral2)).to.be(false); + expect(literal.equals(differentLiteral3)).to.be(false); + expect(literal.equals(differentLiteral4)).to.be(false); + expect(literal.equals(equalLiteral2)).to.be(true); + }); + + }); + +}); + +goog.require('ol.style.TextLiteral'); diff --git a/test/spec/ol/style/text.test.js b/test/spec/ol/style/textsymbolizer.test.js similarity index 81% rename from test/spec/ol/style/text.test.js rename to test/spec/ol/style/textsymbolizer.test.js index 6c8efce73f..77748a943c 100644 --- a/test/spec/ol/style/text.test.js +++ b/test/spec/ol/style/textsymbolizer.test.js @@ -1,71 +1,5 @@ goog.provide('ol.test.style.Text'); -describe('ol.style.TextLiteral', function() { - - describe('#equals()', function() { - - it('identifies equal literals', function() { - var literal = new ol.style.TextLiteral({ - color: '#ff0000', - fontFamily: 'Arial', - fontSize: 11, - text: 'Test', - opacity: 0.5 - }); - var equalLiteral = new ol.style.TextLiteral({ - color: '#ff0000', - fontFamily: 'Arial', - fontSize: 11, - text: 'Test', - opacity: 0.5 - }); - var differentLiteral1 = new ol.style.TextLiteral({ - color: '#0000ff', - fontFamily: 'Arial', - fontSize: 11, - text: 'Test', - opacity: 0.5 - }); - var differentLiteral2 = new ol.style.TextLiteral({ - color: '#ff0000', - fontFamily: 'Dingbats', - fontSize: 11, - text: 'Test', - opacity: 0.5 - }); - var differentLiteral3 = new ol.style.TextLiteral({ - color: '#ff0000', - fontFamily: 'Arial', - fontSize: 12, - text: 'Test', - opacity: 0.5 - }); - var differentLiteral4 = new ol.style.TextLiteral({ - color: '#ff0000', - fontFamily: 'Arial', - fontSize: 11, - text: 'Test', - opacity: 0.6 - }); - var equalLiteral2 = new ol.style.TextLiteral({ - color: '#ff0000', - fontFamily: 'Arial', - fontSize: 11, - text: 'Text is not compared for equality', - opacity: 0.5 - }); - expect(literal.equals(equalLiteral)).to.be(true); - expect(literal.equals(differentLiteral1)).to.be(false); - expect(literal.equals(differentLiteral2)).to.be(false); - expect(literal.equals(differentLiteral3)).to.be(false); - expect(literal.equals(differentLiteral4)).to.be(false); - expect(literal.equals(equalLiteral2)).to.be(true); - }); - - }); - -}); - describe('ol.style.Text', function() { describe('constructor', function() {