Add setRotateWithView function to ol/style/Text
This commit is contained in:
1 parent
f0a97ee460
commit
4cb9b1eeb3
2 files changed
+19
No files matched your search
@@ -401,6 +401,16 @@ class Text {
|
||||
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.
|
||||
*
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
Reference in new issue
Block a user