move 'image' member from marker down to Icon.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@446 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -17,9 +17,6 @@ OpenLayers.Marker.prototype = {
|
||||
/** @type OpenLayers.Map */
|
||||
map: null,
|
||||
|
||||
/** @type DOMElement */
|
||||
image: null,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*
|
||||
@@ -28,16 +25,9 @@ OpenLayers.Marker.prototype = {
|
||||
*/
|
||||
initialize: function(lonlat, icon) {
|
||||
this.lonlat = lonlat;
|
||||
|
||||
this.icon = (icon) ? icon : OpenLayers.Marker.defaultIcon();
|
||||
|
||||
this.image = OpenLayers.Util.createAlphaImageDiv(null,
|
||||
null,
|
||||
this.icon.size,
|
||||
this.icon.url,
|
||||
"absolute"
|
||||
);
|
||||
this.events = new OpenLayers.Events(this, this.image, null);
|
||||
this.events = new OpenLayers.Events(this, this.icon.image, null);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -48,18 +38,16 @@ OpenLayers.Marker.prototype = {
|
||||
* @type DOMElement
|
||||
*/
|
||||
draw: function(px) {
|
||||
this.moveTo(px);
|
||||
return this.image;
|
||||
return this.icon.draw(px);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Pixel} px
|
||||
*/
|
||||
moveTo: function (px) {
|
||||
if ((px != null) && (this.image != null)) {
|
||||
this.image.style.top = (px.y + this.icon.offset.y) + "px"
|
||||
this.image.style.left = (px.x + this.icon.offset.x) + "px";
|
||||
}
|
||||
if ((px != null) && (this.icon != null)) {
|
||||
this.icon.moveTo(px);
|
||||
}
|
||||
},
|
||||
|
||||
/** @final @type String */
|
||||
|
||||
Reference in New Issue
Block a user