Optional zIndex for icon symbolizers

This commit is contained in:
Tim Schaub
2013-08-26 15:30:54 -06:00
parent 33cacab11c
commit b7cb21dc4a
5 changed files with 87 additions and 10 deletions
+27
View File
@@ -30,6 +30,18 @@ describe('ol.style.Icon', function() {
expect(symbolizer).to.be.a(ol.style.Icon);
});
it('accepts zIndex', function() {
var symbolizer = new ol.style.Icon({
height: ol.expr.parse('10'),
width: ol.expr.parse('20'),
opacity: ol.expr.parse('1'),
rotation: ol.expr.parse('0.1'),
url: ol.expr.parse('"http://example.com/1.png"'),
zIndex: 3
});
expect(symbolizer).to.be.a(ol.style.Icon);
});
});
describe('#createLiteral()', function() {
@@ -65,6 +77,7 @@ describe('ol.style.Icon', function() {
expect(literal.xOffset).to.be(20);
expect(literal.yOffset).to.be(30);
expect(literal.url).to.be('http://example.com/1.png');
expect(literal.zIndex).to.be(undefined);
});
it('can be called without a feature', function() {
@@ -223,6 +236,20 @@ describe('ol.style.Icon', function() {
expect(literal.yOffset).to.be(42);
});
it('handles zIndex', function() {
var symbolizer = new ol.style.Icon({
height: ol.expr.parse('10'),
width: ol.expr.parse('20'),
url: ol.expr.parse('"http://example.com/1.png"'),
zIndex: 4
});
var literal = symbolizer.createLiteral(ol.geom.GeometryType.POINT);
expect(literal).to.be.a(ol.style.IconLiteral);
expect(literal.xOffset).to.be(0);
expect(literal.zIndex).to.be(4);
});
});
describe('#getHeight()', function() {