update Control, Marker, and Popup such that they all have draw(px) and move(px) functions. standardization. update tests.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@255 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-05-22 12:50:09 +00:00
parent 9fd1d458ae
commit 08e7a5f10f
7 changed files with 57 additions and 24 deletions
+14 -4
View File
@@ -42,17 +42,27 @@ OpenLayers.Marker.prototype = {
},
/**
* @param {OpenLayers.Pixel} pixel
* @param {OpenLayers.Pixel} px
*
* @return A new DOM Image with this marker´s icon set at the
* location passed-in
* @type DOMElement
*/
draw: function(pixel) {
this.image.style.top = (pixel.y + this.icon.offset.y) + "px"
this.image.style.left = (pixel.x + this.icon.offset.x) + "px";
draw: function(px) {
this.image.style.top = (px.y + this.icon.offset.y) + "px"
this.image.style.left = (px.x + this.icon.offset.x) + "px";
return this.image;
},
/**
* @param {OpenLayers.Pixel} px
*/
moveTo: function (px) {
if ((px != null) && (this.div != null)) {
this.image.style.top = (px.y + this.icon.offset.y) + "px"
this.image.style.left = (px.x + this.icon.offset.x) + "px";
}
},
/** @final @type String */
CLASS_NAME: "OpenLayers.Marker"