Make stroke style of the graticule configurable

This commit is contained in:
Marc Jansen
2014-07-25 12:03:43 +02:00
committed by Éric Lemoine
parent b8dca21286
commit b60609d93c
4 changed files with 54 additions and 5 deletions

View File

@@ -21,6 +21,28 @@ describe('ol.Graticule', function() {
expect(graticule.getMeridians().length).to.be(13);
expect(graticule.getParallels().length).to.be(3);
});
it('has a default stroke style', function() {
var actualStyle = graticule.strokeStyle_;
expect(actualStyle).not.to.be(undefined);
expect(actualStyle instanceof ol.style.Stroke).to.be(true);
});
it('can be configured with a stroke style', function() {
var customStrokeStyle = new ol.style.Stroke({
color: 'rebeccapurple'
});
var styledGraticule = new ol.Graticule({
map: new ol.Map({}),
strokeStyle: customStrokeStyle
});
var actualStyle = styledGraticule.strokeStyle_;
expect(actualStyle).not.to.be(undefined);
expect(actualStyle).to.be(customStrokeStyle);
});
});
});
@@ -28,3 +50,4 @@ describe('ol.Graticule', function() {
goog.require('ol.Graticule');
goog.require('ol.Map');
goog.require('ol.proj');
goog.require('ol.style.Stroke');