For stars, use radius1 and radius2 in ol.style.RegularShape

This commit is contained in:
Bart van den Eijnden
2014-11-28 14:22:02 +01:00
parent 9e591d21d0
commit da39e9f96a
3 changed files with 62 additions and 8 deletions

View File

@@ -0,0 +1,36 @@
goog.provide('ol.test.style.RegularShape');
describe('ol.style.RegularShape', function() {
it('can use radius', function() {
var style = new ol.style.RegularShape({
radius: 5,
radius2: 10
});
expect(style.getRadius()).to.eql(5);
expect(style.getRadius2()).to.eql(10);
});
it('can use radius1 as an alias for radius', function() {
var style = new ol.style.RegularShape({
radius1: 5,
radius2: 10
});
expect(style.getRadius()).to.eql(5);
expect(style.getRadius2()).to.eql(10);
});
it('will use radius for radius2 if radius2 not defined', function() {
var style = new ol.style.RegularShape({
radius: 5
});
expect(style.getRadius()).to.eql(5);
expect(style.getRadius2()).to.eql(5);
});
it('will use radius1 for radius2 if radius2 not defined', function() {
var style = new ol.style.RegularShape({
radius1: 5
});
expect(style.getRadius()).to.eql(5);
expect(style.getRadius2()).to.eql(5);
});
});
goog.require('ol.style.RegularShape');