Add clone methods to styles

This commit is contained in:
simonseyock
2016-09-01 16:19:56 +01:00
committed by Simon Seyock
parent f61a43b3c6
commit c561f1587b
7 changed files with 163 additions and 5 deletions
+12
View File
@@ -30,6 +30,18 @@ ol.style.Fill = function(opt_options) {
};
/**
* Clones the style.
* @return {ol.style.Fill} The cloned style.
* @api
*/
ol.style.Fill.prototype.clone = function() {
return new ol.style.Fill({
color: (this.getColor() instanceof Array) ? this.getColor().slice(0) : this.getColor()
});
};
/**
* Get the fill color.
* @return {ol.Color|ol.ColorLike} Color.