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

View File

@@ -18,16 +18,29 @@ OpenLayers.Control.prototype = {
},
/**
* @param {OpenLayers.Pixel} px
*
* @returns A reference to the DIV DOMElement containing the control
* @type DOMElement
*/
draw: function () {
draw: function (px) {
if (this.div == null) {
this.div = OpenLayers.Util.createDiv();
}
this.moveTo(px);
return this.div;
},
/**
* @param {OpenLayers.Pixel} px
*/
moveTo: function (px) {
if ((px != null) && (this.div != null)) {
this.div.style.left = px.x + "px";
this.div.style.top = px.x + "px";
}
},
/**
*/
destroy: function () {