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
This commit is contained in:
euzuro
2006-05-27 00:47:11 +00:00
parent cd07fd2a93
commit 3691bc54b6

View File

@@ -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);