Default value for zIndex

This commit is contained in:
Tim Schaub
2013-10-02 16:37:19 -06:00
parent 43c581ef5f
commit bfa257eac1
20 changed files with 262 additions and 124 deletions

View File

@@ -58,7 +58,7 @@ describe('ol.style.Shape', function() {
expect(literal).to.be.a(ol.style.ShapeLiteral);
expect(literal.size).to.be(42);
expect(literal.fillOpacity).to.be(0.4);
expect(literal.zIndex).to.be(undefined);
expect(literal.zIndex).to.be(0);
});
it('can be called without a feature', function() {
@@ -185,6 +185,24 @@ describe('ol.style.Shape', function() {
expect(literal.zIndex).to.be(-2);
});
it('casts zIndex to number', function() {
var symbolizer = new ol.style.Shape({
fill: new ol.style.Fill({
color: '#BADA55'
}),
zIndex: ol.expr.parse('zIndex')
});
var feature = new ol.Feature({
zIndex: '42',
geometry: new ol.geom.Point([1, 2])
});
var literal = symbolizer.createLiteral(feature);
expect(literal).to.be.a(ol.style.ShapeLiteral);
expect(literal.zIndex).to.be(42);
});
});
describe('#getFill()', function() {