implement dynamic offset (pass in calculateOffset() function) and implement dynamic alpha-safe sizing. I realize some tests still fail. I have to run out for some errands, will be back in 3-4 hours to fix this (namely text layer still has issues. fear not, i will fix these)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@450 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-05-29 13:54:38 +00:00
parent 77e618482a
commit 51aaf18b59
2 changed files with 47 additions and 20 deletions
+5 -3
View File
@@ -27,7 +27,7 @@ OpenLayers.Marker.prototype = {
this.lonlat = lonlat;
this.icon = (icon) ? icon : OpenLayers.Marker.defaultIcon();
this.events = new OpenLayers.Events(this, this.icon.image, null);
this.events = new OpenLayers.Events(this, this.icon.imageDiv, null);
},
/**
@@ -49,7 +49,7 @@ OpenLayers.Marker.prototype = {
this.icon.moveTo(px);
}
},
/** @final @type String */
CLASS_NAME: "OpenLayers.Marker"
};
@@ -62,7 +62,9 @@ OpenLayers.Marker.prototype = {
OpenLayers.Marker.defaultIcon = function() {
var url = OpenLayers.Util.getImagesLocation() + "marker.png";
var size = new OpenLayers.Size(21, 25);
var offset = new OpenLayers.Pixel(-(size.w/2), -size.h);
var offset = function(size) {
return OpenLayers.Pixel(-(size.w/2), -size.h);
};
return new OpenLayers.Icon(url, size, offset);
};