commenting/JSDOC/coding standards

git-svn-id: http://svn.openlayers.org/trunk/openlayers@647 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-06-21 13:44:30 +00:00
parent ee2b60ff6b
commit 82f40f8f3f
+44 -5
View File
@@ -1,16 +1,25 @@
// @require: OpenLayers/Control.js // @require: OpenLayers/Control.js
//
// default zoom/pan controls /**
// * @class
*
* default zoom/pan controls
*/
OpenLayers.Control.PanZoom = Class.create(); OpenLayers.Control.PanZoom = Class.create();
OpenLayers.Control.PanZoom.X = 4; OpenLayers.Control.PanZoom.X = 4;
OpenLayers.Control.PanZoom.Y = 4; OpenLayers.Control.PanZoom.Y = 4;
OpenLayers.Control.PanZoom.prototype = OpenLayers.Control.PanZoom.prototype =
Object.extend( new OpenLayers.Control(), { Object.extend( new OpenLayers.Control(), {
/** @type Array(...) */ /** @type Array of Button Divs */
buttons: null, buttons: null,
/** @type OpenLayers.Pixel */
position: null,
/**
* @constructor
*/
initialize: function() { initialize: function() {
OpenLayers.Control.prototype.initialize.apply(this, arguments); OpenLayers.Control.prototype.initialize.apply(this, arguments);
this.position = new OpenLayers.Pixel(OpenLayers.Control.PanZoom.X, this.position = new OpenLayers.Pixel(OpenLayers.Control.PanZoom.X,
@@ -19,6 +28,9 @@ OpenLayers.Control.PanZoom.prototype =
/** /**
* @param {OpenLayers.Pixel} px * @param {OpenLayers.Pixel} px
*
* @returns A reference to the container div for the PanZoom control
* @type DOMElement
*/ */
draw: function(px) { draw: function(px) {
// initialize our internal div // initialize our internal div
@@ -41,6 +53,18 @@ OpenLayers.Control.PanZoom.prototype =
this._addButton("zoomout", "zoom-minus-mini.png", centered.add(0, sz.h*5+5), sz); this._addButton("zoomout", "zoom-minus-mini.png", centered.add(0, sz.h*5+5), sz);
return this.div; return this.div;
}, },
/**
* @param {String} id
* @param {String} img
* @param {OpenLayers.Pixel} xy
* @param {OpenLayers.Size} sz
*
* @returns A Div (an alphaImageDiv, to be precise) that contains the
* image of the button, and has all the proper event handlers
* set.
* @type DOMElement
*/
_addButton:function(id, img, xy, sz) { _addButton:function(id, img, xy, sz) {
var imgLocation = OpenLayers.Util.getImagesLocation() + img; var imgLocation = OpenLayers.Util.getImagesLocation() + img;
// var btn = new ol.AlphaImage("_"+id, imgLocation, xy, sz); // var btn = new ol.AlphaImage("_"+id, imgLocation, xy, sz);
@@ -62,11 +86,19 @@ OpenLayers.Control.PanZoom.prototype =
return btn; return btn;
}, },
/**
* @param {event} evt
*
* @type Boolean
*/
doubleClick: function (evt) { doubleClick: function (evt) {
Event.stop(evt); Event.stop(evt);
return false; return false;
}, },
/**
* @param {event} evt
*/
buttonDown: function (evt) { buttonDown: function (evt) {
switch (this.action) { switch (this.action) {
case "panup": case "panup":
@@ -107,10 +139,17 @@ OpenLayers.Control.PanZoom.prototype =
} }
Event.stop(evt); Event.stop(evt);
}, },
/**
*
*/
destroy: function() { destroy: function() {
OpenLayers.Control.prototype.destroy.apply(this, arguments); OpenLayers.Control.prototype.destroy.apply(this, arguments);
for(i=0; i<this.buttons.length; i++) { for(i=0; i<this.buttons.length; i++) {
this.buttons[i].map = null; this.buttons[i].map = null;
} }
} },
/** @final @type String */
CLASS_NAME: "OpenLayers.Control.PanZoom"
}); });