Make icon size optional

This commit is contained in:
Éric Lemoine
2013-11-26 16:19:33 +01:00
parent 519e2539cc
commit 9365c227ab
2 changed files with 20 additions and 3 deletions
+6
View File
@@ -114,6 +114,12 @@ ol.style.Image.prototype.handleImageError_ = function() {
*/
ol.style.Image.prototype.handleImageLoad_ = function() {
this.imageState = ol.style.ImageState.LOADED;
if (goog.isNull(this.size)) {
this.size = [this.image.width, this.image.height];
}
if (goog.isNull(this.anchor)) {
this.anchor = [this.size[0] / 2, this.size[1] / 2];
}
this.unlistenImage_();
this.dispatchChangeEvent_();
};