Adding counter expression function

This function can e.g. be used to get a symbolizer literal with
an ever increasing zIndex.
This commit is contained in:
ahocevar
2013-10-03 11:41:02 -06:00
parent 17356bc3ee
commit 4937f08971
2 changed files with 27 additions and 0 deletions

View File

@@ -674,6 +674,15 @@ describe('ol.expr.lib', function() {
});
describe('counter()', function() {
var counter = parse('counter()');
var counterWithStart = parse('counter(1000)');
var start = evaluate(counter);
expect(evaluate(counter).to.be(start + 1));
expect(evaluate(counter).to.be(start + 2));
expect(evaluate(counterWithStart).to.be(start + 3 + 1000));
});
describe('extent()', function() {
var nw = new ol.Feature({