add 'offset' member to OpenLayers.Icon - and then use it in OpenLayers.Marker

git-svn-id: http://svn.openlayers.org/trunk/openlayers@127 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-05-18 05:04:06 +00:00
parent 19e6574395
commit 2086a1ad95
2 changed files with 13 additions and 4 deletions
+1 -3
View File
@@ -38,9 +38,7 @@ OpenLayers.Marker.prototype = {
generateMarker: function(pixel) {
// Create a div here, and set the location to the pixel above modified
// by the icon size.
var markerOffset = new OpenLayers.Pixel(this.icon.size.w / 2,
this.icon.size.h);
var iconPosition = pixel.diff(markerOffset);
var iconPosition = pixel.diff(this.icon.offset);
var markerObject = OpenLayers.Util.createImage(this.icon.url,
this.icon.size,
iconPosition);