Optional zIndex for icon symbolizers
This commit is contained in:
@@ -54,12 +54,21 @@ describe('ol.style.IconLiteral', function() {
|
||||
rotation: 0.1,
|
||||
url: 'http://example.com/2.png'
|
||||
});
|
||||
var differentZIndex = new ol.style.IconLiteral({
|
||||
height: 10,
|
||||
width: 20,
|
||||
opacity: 1,
|
||||
rotation: 0.1,
|
||||
url: 'http://example.com/1.png',
|
||||
zIndex: 20
|
||||
});
|
||||
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);
|
||||
expect(literal.equals(differentZIndex)).to.be(false);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user