commenting/JSDOC/coding standards
git-svn-id: http://svn.openlayers.org/trunk/openlayers@647 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -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<this.buttons.length; i++) {
|
||||
this.buttons[i].map = null;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/** @final @type String */
|
||||
CLASS_NAME: "OpenLayers.Control.PanZoom"
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user