Added cloning of image element, color cloning

This commit is contained in:
Simon Seyock
2016-09-05 19:52:53 +02:00
parent 147f091998
commit 9f32e8d566
5 changed files with 27 additions and 12 deletions
+3 -2
View File
@@ -31,13 +31,14 @@ ol.style.Fill = function(opt_options) {
/**
* Clones the style.
* Clones the style. The color is not cloned if it is an {@link ol.ColorLike}.
* @return {ol.style.Fill} The cloned style.
* @api
*/
ol.style.Fill.prototype.clone = function() {
var color = this.getColor();
return new ol.style.Fill({
color: (this.getColor() instanceof Array) ? this.getColor().slice(0) : this.getColor()
color: (color && color.slice) ? color.slice() : color || undefined
});
};