Add a getGeometry method

This commit is contained in:
Andreas Hocevar
2014-12-18 10:28:21 +01:00
parent 2bf191b5e3
commit 784701641d
2 changed files with 43 additions and 7 deletions

View File

@@ -40,6 +40,24 @@ describe('ol.style.Style', function() {
});
});
describe('#getGeometry', function() {
it('returns whatever was passed to setGeometry', function() {
var style = new ol.style.Style();
style.setGeometry('foo');
expect(style.getGeometry()).to.eql('foo');
var geom = new ol.geom.Point([1, 2]);
style.setGeometry(geom);
expect(style.getGeometry()).to.eql(geom);
var fn = function() { return geom; };
style.setGeometry(fn);
expect(style.getGeometry()).to.eql(fn);
style.setGeometry(null);
expect(style.getGeometry()).to.eql(null);
});
});
});
describe('ol.style.createStyleFunction()', function() {