Add stroke properties to text symbolizer literal
This commit is contained in:
@@ -2,6 +2,54 @@ goog.provide('ol.test.style.TextLiteral');
|
||||
|
||||
describe('ol.style.TextLiteral', function() {
|
||||
|
||||
describe('constructor', function() {
|
||||
|
||||
it('creates a new literal', function() {
|
||||
var literal = new ol.style.TextLiteral({
|
||||
color: '#ff0000',
|
||||
fontFamily: 'Arial',
|
||||
fontSize: 11,
|
||||
text: 'Test',
|
||||
opacity: 0.5,
|
||||
zIndex: 0
|
||||
});
|
||||
expect(literal).to.be.a(ol.style.Literal);
|
||||
expect(literal).to.be.a(ol.style.TextLiteral);
|
||||
});
|
||||
|
||||
it('accepts stroke properties', function() {
|
||||
var literal = new ol.style.TextLiteral({
|
||||
color: '#ff0000',
|
||||
fontFamily: 'Arial',
|
||||
fontSize: 11,
|
||||
text: 'Test',
|
||||
opacity: 0.5,
|
||||
strokeColor: '#ff0000',
|
||||
strokeWidth: 2,
|
||||
strokeOpacity: 0.5,
|
||||
zIndex: 0
|
||||
});
|
||||
expect(literal).to.be.a(ol.style.TextLiteral);
|
||||
});
|
||||
|
||||
it('throws with incomplete stroke properties', function() {
|
||||
expect(function() {
|
||||
new ol.style.TextLiteral({
|
||||
color: '#ff0000',
|
||||
fontFamily: 'Arial',
|
||||
fontSize: 11,
|
||||
text: 'Test',
|
||||
opacity: 0.5,
|
||||
strokeColor: '#ff0000',
|
||||
zIndex: 0
|
||||
});
|
||||
}).throwException(function(err) {
|
||||
expect(err).to.be.a(goog.asserts.AssertionError);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('#equals()', function() {
|
||||
|
||||
it('identifies equal literals', function() {
|
||||
@@ -82,4 +130,6 @@ describe('ol.style.TextLiteral', function() {
|
||||
|
||||
});
|
||||
|
||||
goog.require('goog.asserts.AssertionError');
|
||||
goog.require('ol.style.Literal');
|
||||
goog.require('ol.style.TextLiteral');
|
||||
|
||||
Reference in New Issue
Block a user