Merge pull request #9240 from fredj/text_rotateWithView

Add setRotateWithView function to ol/style/Text
This commit is contained in:
Frédéric Junod
2019-02-19 15:29:00 +01:00
committed by GitHub
2 changed files with 222 additions and 203 deletions
+10
View File
@@ -401,6 +401,16 @@ class Text {
this.placement_ = placement; this.placement_ = placement;
} }
/**
* Set whether to rotate the text with the view.
*
* @param {boolean} rotateWithView Rotate with map.
* @api
*/
setRotateWithView(rotateWithView) {
this.rotateWithView_ = rotateWithView;
}
/** /**
* Set the fill. * Set the fill.
* *
+9
View File
@@ -97,4 +97,13 @@ describe('ol.style.Text', function() {
}); });
describe('#setRotateWithView', function() {
it('sets the rotateWithView property', function() {
const textStyle = new Text();
expect(textStyle.getRotateWithView()).to.eql(undefined);
textStyle.setRotateWithView(true);
expect(textStyle.getRotateWithView()).to.eql(true);
});
});
}); });