1 /* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
 
   2  * See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
 
   3  * text of the license. */
 
   7 OpenLayers.Control = Class.create();
 
   8 OpenLayers.Control.prototype = {
 
  10     /** this gets set in the addControl() function in OpenLayers.Map
 
  11     * @type OpenLayers.Map */
 
  14     /** @type DOMElement */
 
  17     /** @type OpenLayers.Pixel */
 
  23     initialize: function (options) {
 
  24         Object.extend(this, options);
 
  28     * @param {OpenLayers.Pixel} px
 
  30     * @returns A reference to the DIV DOMElement containing the control
 
  34         if (this.div == null) {
 
  35             this.div = OpenLayers.Util.createDiv();
 
  38             this.position = px.copyOf();
 
  40         this.moveTo(this.position);        
 
  45     * @param {OpenLayers.Pixel} px
 
  47     moveTo: function (px) {
 
  48         if ((px != null) && (this.div != null)) {
 
  49             this.div.style.left = px.x + "px";
 
  50             this.div.style.top = px.x + "px";
 
  56     destroy: function () {
 
  57         // eliminate circular references
 
  61     /** @final @type String */
 
  62     CLASS_NAME: "OpenLayers.Control"