Added a position property to Control, which allows us to specify a default

location for each Control class, and saves us from *having* to supply a pixel
position to the map.addControl() method -- the sensible default will tend to be
used instead.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@269 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Schuyler Erle
2006-05-22 17:25:46 +00:00
parent d8ddc5aa36
commit 7378388d45
4 changed files with 22 additions and 9 deletions

View File

@@ -11,6 +11,9 @@ OpenLayers.Control.prototype = {
/** @type DOMElement */
div: null,
/** @type OpenLayers.Pixel */
position: null,
/**
* @constructor
*/
@@ -27,7 +30,10 @@ OpenLayers.Control.prototype = {
if (this.div == null) {
this.div = OpenLayers.Util.createDiv();
}
this.moveTo(px);
if (px != null) {
this.position = px.copyOf();
}
this.moveTo(this.position);
return this.div;
},