From 82f40f8f3f2d5a3db7de2a465ca66dff6d280ffb Mon Sep 17 00:00:00 2001 From: euzuro Date: Wed, 21 Jun 2006 13:44:30 +0000 Subject: [PATCH] commenting/JSDOC/coding standards git-svn-id: http://svn.openlayers.org/trunk/openlayers@647 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Control/PanZoom.js | 49 +++++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 5 deletions(-) diff --git a/lib/OpenLayers/Control/PanZoom.js b/lib/OpenLayers/Control/PanZoom.js index 8ae460b94d..234a8ada76 100644 --- a/lib/OpenLayers/Control/PanZoom.js +++ b/lib/OpenLayers/Control/PanZoom.js @@ -1,16 +1,25 @@ // @require: OpenLayers/Control.js -// -// default zoom/pan controls -// + +/** + * @class + * + * default zoom/pan controls + */ OpenLayers.Control.PanZoom = Class.create(); OpenLayers.Control.PanZoom.X = 4; OpenLayers.Control.PanZoom.Y = 4; OpenLayers.Control.PanZoom.prototype = Object.extend( new OpenLayers.Control(), { - /** @type Array(...) */ + /** @type Array of Button Divs */ buttons: null, + /** @type OpenLayers.Pixel */ + position: null, + + /** + * @constructor + */ initialize: function() { OpenLayers.Control.prototype.initialize.apply(this, arguments); this.position = new OpenLayers.Pixel(OpenLayers.Control.PanZoom.X, @@ -19,6 +28,9 @@ OpenLayers.Control.PanZoom.prototype = /** * @param {OpenLayers.Pixel} px + * + * @returns A reference to the container div for the PanZoom control + * @type DOMElement */ draw: function(px) { // 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); 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) { var imgLocation = OpenLayers.Util.getImagesLocation() + img; // var btn = new ol.AlphaImage("_"+id, imgLocation, xy, sz); @@ -62,11 +86,19 @@ OpenLayers.Control.PanZoom.prototype = return btn; }, + /** + * @param {event} evt + * + * @type Boolean + */ doubleClick: function (evt) { Event.stop(evt); return false; }, + /** + * @param {event} evt + */ buttonDown: function (evt) { switch (this.action) { case "panup": @@ -107,10 +139,17 @@ OpenLayers.Control.PanZoom.prototype = } Event.stop(evt); }, + + /** + * + */ destroy: function() { OpenLayers.Control.prototype.destroy.apply(this, arguments); for(i=0; i