diff --git a/lib/OpenLayers/Icon.js b/lib/OpenLayers/Icon.js index dfa11f4555..c6e02a33d1 100644 --- a/lib/OpenLayers/Icon.js +++ b/lib/OpenLayers/Icon.js @@ -27,7 +27,7 @@ OpenLayers.Icon.prototype = { this.url = url; this.offset = offset; - if (offset == null) { + if ((size != null) && (offset == null)) { // default offset this.offset = new OpenLayers.Pixel(-(size.w / 2), -size.h); }