Line literal color instead of strokeColor etc.
This commit is contained in:
@@ -6,22 +6,34 @@ describe('ol.style.LineLiteral', function() {
|
||||
|
||||
it('identifies equal literals', function() {
|
||||
var literal = new ol.style.LineLiteral({
|
||||
strokeWidth: 3,
|
||||
strokeColor: '#BADA55',
|
||||
strokeOpacity: 1
|
||||
width: 3,
|
||||
color: '#BADA55',
|
||||
opacity: 1
|
||||
});
|
||||
var equalLiteral = new ol.style.LineLiteral({
|
||||
strokeColor: '#BADA55',
|
||||
strokeWidth: 3,
|
||||
strokeOpacity: 1
|
||||
color: '#BADA55',
|
||||
width: 3,
|
||||
opacity: 1
|
||||
});
|
||||
var differentLiteral = new ol.style.LineLiteral({
|
||||
strokeColor: '#013',
|
||||
strokeWidth: 3,
|
||||
strokeOpacity: 1
|
||||
var differentColor = new ol.style.LineLiteral({
|
||||
width: 3,
|
||||
color: '#ff0000',
|
||||
opacity: 1
|
||||
});
|
||||
var differentWidth = new ol.style.LineLiteral({
|
||||
width: 3.5,
|
||||
color: '#BADA55',
|
||||
opacity: 1
|
||||
});
|
||||
var differentOpacity = new ol.style.LineLiteral({
|
||||
width: 3,
|
||||
color: '#BADA55',
|
||||
opacity: 0.5
|
||||
});
|
||||
expect(literal.equals(equalLiteral)).to.be(true);
|
||||
expect(literal.equals(differentLiteral)).to.be(false);
|
||||
expect(literal.equals(differentColor)).to.be(false);
|
||||
expect(literal.equals(differentWidth)).to.be(false);
|
||||
expect(literal.equals(differentOpacity)).to.be(false);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -38,8 +38,8 @@ describe('ol.style.Stroke', function() {
|
||||
|
||||
var literal = symbolizer.createLiteral(feature);
|
||||
expect(literal).to.be.a(ol.style.LineLiteral);
|
||||
expect(literal.strokeOpacity).to.be(42 / 100);
|
||||
expect(literal.strokeWidth).to.be(1.5);
|
||||
expect(literal.opacity).to.be(42 / 100);
|
||||
expect(literal.width).to.be(1.5);
|
||||
});
|
||||
|
||||
it('applies the default values', function() {
|
||||
@@ -47,9 +47,9 @@ describe('ol.style.Stroke', function() {
|
||||
|
||||
var literal = symbolizer.createLiteral(ol.geom.GeometryType.LINESTRING);
|
||||
expect(literal).to.be.a(ol.style.LineLiteral);
|
||||
expect(literal.strokeColor).to.be('#696969');
|
||||
expect(literal.strokeOpacity).to.be(0.75);
|
||||
expect(literal.strokeWidth).to.be(1.5);
|
||||
expect(literal.color).to.be('#696969');
|
||||
expect(literal.opacity).to.be(0.75);
|
||||
expect(literal.width).to.be(1.5);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -65,9 +65,9 @@ describe('ol.style.Style', function() {
|
||||
|
||||
var literal = literals[0];
|
||||
expect(literal).to.be.a(ol.style.LineLiteral);
|
||||
expect(literal.strokeColor).to.be(ol.style.StrokeDefaults.color);
|
||||
expect(literal.strokeOpacity).to.be(ol.style.StrokeDefaults.opacity);
|
||||
expect(literal.strokeWidth).to.be(ol.style.StrokeDefaults.width);
|
||||
expect(literal.color).to.be(ol.style.StrokeDefaults.color);
|
||||
expect(literal.opacity).to.be(ol.style.StrokeDefaults.opacity);
|
||||
expect(literal.width).to.be(ol.style.StrokeDefaults.width);
|
||||
});
|
||||
|
||||
it('returns an array with the Polygon default for polygons', function() {
|
||||
|
||||
Reference in New Issue
Block a user