Added ol.style.Icon#clone test

This commit is contained in:
Simon Seyock
2016-09-05 19:26:55 +02:00
parent a183c66704
commit 147f091998
3 changed files with 66 additions and 5 deletions

View File

@@ -181,18 +181,18 @@ ol.inherits(ol.style.Icon, ol.style.Image);
ol.style.Icon.prototype.clone = function() {
var useImg = (this.iconImage_.getImageState() === ol.Image.State.LOADED);
return new ol.style.Icon({
anchor: this.getAnchor().slice(0),
anchorOrigin: this.anchorOrigin_.slice(0),
anchor: this.anchor_.slice(0),
anchorOrigin: this.anchorOrigin_,
anchorXUnits: this.anchorXUnits_,
anchorYUnits: this.anchorYUnits_,
crossOrigin: this.crossOrigin_,
color: this.color_.slice(0),
color: this.color_ !== null ? this.color_.slice(0) : undefined,
img: useImg ? this.getImage(1) : undefined,
imgSize: useImg ? this.iconImage_.getSize().slice(0) : undefined,
src: useImg ? undefined : this.getSrc(),
offset: this.offset_.slice(0),
offsetOrigin: this.offsetOrigin_,
size: this.getSize().slice(0),
size: this.size_ !== null ? this.size_.slice(0) : undefined,
opacity: this.getOpacity(),
scale: this.getScale(),
snapToPixel: this.getSnapToPixel(),