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:
@@ -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;
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user