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
+12 -1
View File
@@ -6,10 +6,21 @@ OpenLayers.Icon.prototype = {
// {OpenLayers.Size}: size of image
size:null,
/** distance in pixels to offset the image when being rendered
* @type OpenLayers.Pixel */
offset: null,
initialize: function(url, size) {
initialize: function(url, size, offset) {
this.size = size;
this.url = url;
this.offset = offset;
if (offset == null) {
// default offset
this.offset = new OpenLayers.Pixel(size.w / 2, size.h);
}
},
// Create a copy of this icon.