diff --git a/lib/OpenLayers/Icon.js b/lib/OpenLayers/Icon.js index 28584930e3..5d48781d2a 100644 --- a/lib/OpenLayers/Icon.js +++ b/lib/OpenLayers/Icon.js @@ -40,7 +40,7 @@ OpenLayers.Icon.prototype = { initialize: function(url, size, offset, calculateOffset) { this.url = url; this.size = (size) ? size : new OpenLayers.Size(20,20); - this.offset = offset ? offset : new OpenLayers.Pixel(-(size.w/2), -(size.h/2)); + this.offset = offset ? offset : new OpenLayers.Pixel(-(this.size.w/2), -(this.size.h/2)); this.calculateOffset = calculateOffset; var id = OpenLayers.Util.createUniqueID("OL_Icon_");