Optional zIndex for fill symbolizers
This commit is contained in:
@@ -19,6 +19,15 @@ describe('ol.style.Fill', function() {
|
||||
expect(symbolizer).to.be.a(ol.style.Fill);
|
||||
});
|
||||
|
||||
it('accepts zIndex', function() {
|
||||
var symbolizer = new ol.style.Fill({
|
||||
opacity: ol.expr.parse('value / 100'),
|
||||
color: ol.expr.parse('fillAttr'),
|
||||
zIndex: 3
|
||||
});
|
||||
expect(symbolizer).to.be.a(ol.style.Fill);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('#createLiteral()', function() {
|
||||
@@ -40,6 +49,7 @@ describe('ol.style.Fill', function() {
|
||||
expect(literal).to.be.a(ol.style.PolygonLiteral);
|
||||
expect(literal.fillOpacity).to.be(42 / 100);
|
||||
expect(literal.fillColor).to.be('#ff0000');
|
||||
expect(literal.zIndex).to.be(undefined);
|
||||
});
|
||||
|
||||
it('applies default opacity', function() {
|
||||
@@ -81,6 +91,19 @@ describe('ol.style.Fill', function() {
|
||||
expect(literal.fillOpacity).to.be(0.55);
|
||||
});
|
||||
|
||||
it('handles zIndex', function() {
|
||||
var symbolizer = new ol.style.Fill({
|
||||
opacity: 0.8,
|
||||
zIndex: 2
|
||||
});
|
||||
|
||||
var literal = symbolizer.createLiteral(ol.geom.GeometryType.POLYGON);
|
||||
expect(literal).to.be.a(ol.style.PolygonLiteral);
|
||||
expect(literal.fillColor).to.be('#ffffff');
|
||||
expect(literal.fillOpacity).to.be(0.8);
|
||||
expect(literal.zIndex).to.be(2);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('#getColor()', function() {
|
||||
|
||||
@@ -54,12 +54,21 @@ describe('ol.style.PolygonLiteral', function() {
|
||||
fillColor: '#BADA55',
|
||||
fillOpacity: 0.31
|
||||
});
|
||||
var differentZIndex = new ol.style.PolygonLiteral({
|
||||
strokeWidth: 3,
|
||||
strokeColor: '#013',
|
||||
strokeOpacity: 0.4,
|
||||
fillColor: '#BADA55',
|
||||
fillOpacity: 0.3,
|
||||
zIndex: 2
|
||||
});
|
||||
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);
|
||||
expect(literal.equals(differentZIndex)).to.be(false);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user