Add clone methods to styles
This commit is contained in:
committed by
Simon Seyock
parent
f61a43b3c6
commit
c561f1587b
@@ -95,6 +95,28 @@ ol.style.Text = function(opt_options) {
|
||||
ol.style.Text.DEFAULT_FILL_COLOR_ = '#333';
|
||||
|
||||
|
||||
/**
|
||||
* Clones the style.
|
||||
* @return {ol.style.Text} The cloned style.
|
||||
* @api
|
||||
*/
|
||||
ol.style.Text.prototype.clone = function() {
|
||||
return new ol.style.Text({
|
||||
font: this.getFont(),
|
||||
rotation: this.getRotation(),
|
||||
rotateWithView: this.getRotateWithView(),
|
||||
scale: this.getScale(),
|
||||
text: this.getText(),
|
||||
textAlign: this.getTextAlign(),
|
||||
textBaseline: this.getTextBaseline(),
|
||||
fill: this.getFill() ? this.getFill().clone() : undefined,
|
||||
stroke: this.getStroke() ? this.getStroke().clone() : undefined,
|
||||
offsetX: this.getOffsetX(),
|
||||
offsetY: this.getOffsetY()
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Get the font name.
|
||||
* @return {string|undefined} Font.
|
||||
|
||||
Reference in New Issue
Block a user