Consider resolution when applying rules

This commit is contained in:
Tim Schaub
2013-09-27 11:46:48 +02:00
parent 78c54addb3
commit bbef15e50e
7 changed files with 131 additions and 24 deletions
+9 -9
View File
@@ -57,12 +57,12 @@ describe('ol.style.Style', function() {
});
feature.set('foo', 'bar');
var literals = style.createLiterals(feature);
var literals = style.createLiterals(feature, 1);
expect(literals).to.have.length(1);
expect(literals[0].fillColor).to.be('#BADA55');
feature.set('foo', 'baz');
expect(style.createLiterals(feature)).to.have.length(0);
expect(style.createLiterals(feature, 1)).to.have.length(0);
});
it('uses the "else" symbolizers when no rules are provided', function() {
@@ -78,7 +78,7 @@ describe('ol.style.Style', function() {
geometry: new ol.geom.LineString([[1, 2], [3, 4]])
});
var literals = style.createLiterals(feature);
var literals = style.createLiterals(feature, 1);
expect(literals).to.have.length(1);
expect(literals[0].color).to.be('#ff0000');
});
@@ -107,7 +107,7 @@ describe('ol.style.Style', function() {
geometry: new ol.geom.LineString([[1, 2], [3, 4]])
});
var literals = style.createLiterals(feature);
var literals = style.createLiterals(feature, 1);
expect(literals).to.have.length(1);
expect(literals[0].color).to.be('#00ff00');
@@ -115,7 +115,7 @@ describe('ol.style.Style', function() {
name: 'match',
geometry: new ol.geom.LineString([[1, 2], [3, 4]])
});
literals = style.createLiterals(feature);
literals = style.createLiterals(feature, 1);
expect(literals).to.have.length(1);
expect(literals[0].color).to.be('#ff00ff');
});
@@ -133,7 +133,7 @@ describe('ol.style.Style', function() {
it('returns an empty array for features without geometry', function() {
var feature = new ol.Feature();
expect(style.createLiterals(feature))
expect(style.createLiterals(feature, 1))
.to.have.length(0);
});
@@ -141,7 +141,7 @@ describe('ol.style.Style', function() {
var feature = new ol.Feature();
feature.setGeometry(new ol.geom.Point([0, 0]));
var literals = style.createLiterals(feature);
var literals = style.createLiterals(feature, 1);
expect(literals).to.have.length(1);
var literal = literals[0];
@@ -158,7 +158,7 @@ describe('ol.style.Style', function() {
var feature = new ol.Feature();
feature.setGeometry(new ol.geom.LineString([[0, 0], [1, 1]]));
var literals = style.createLiterals(feature);
var literals = style.createLiterals(feature, 1);
expect(literals).to.have.length(1);
var literal = literals[0];
@@ -172,7 +172,7 @@ describe('ol.style.Style', function() {
var feature = new ol.Feature();
feature.setGeometry(new ol.geom.Polygon([[[0, 0], [1, 1], [0, 0]]]));
var literals = style.createLiterals(feature);
var literals = style.createLiterals(feature, 1);
expect(literals).to.have.length(1);
var literal = literals[0];