From 3691bc54b627db71571ef38570cdf1ac30701b4a Mon Sep 17 00:00:00 2001 From: euzuro Date: Sat, 27 May 2006 00:47:11 +0000 Subject: [PATCH] read icon.offset from data object. default to (0,0) git-svn-id: http://svn.openlayers.org/trunk/openlayers@415 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Feature.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/OpenLayers/Feature.js b/lib/OpenLayers/Feature.js index e891899d29..d9043bb87b 100644 --- a/lib/OpenLayers/Feature.js +++ b/lib/OpenLayers/Feature.js @@ -66,7 +66,10 @@ OpenLayers.Feature.prototype= { var imgSize = (this.data.iconSize) ? this.data.iconSize : new OpenLayers.Size(25, 25); - this.icon = new OpenLayers.Icon(imgURL, imgSize); + var imgOffset = (this.data.iconOffset) ? this.data.iconOffset + : new OpenLayers.Pixel(0,0); + + this.icon = new OpenLayers.Icon(imgURL, imgSize, imgOffset); this.marker = new OpenLayers.Marker(this.lonlat, this.icon);