Merge all changes from the naturaldocs sandbox. This brings all the work that
has been done in the NaturalDocs branch back to trunk. Thanks to everyone who helped out in making this happen. (I could list people, but the list would be long, and I'm already mentally on vacation.) git-svn-id: http://svn.openlayers.org/trunk/openlayers@3545 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -1,38 +1,54 @@
|
||||
/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
|
||||
/* Cpyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
|
||||
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
|
||||
* for the full text of the license. */
|
||||
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/Control.js
|
||||
*
|
||||
* Class: OpenLayers.Control.ArgParser
|
||||
*
|
||||
* Inherits from:
|
||||
* - <OpenLayers.Control>
|
||||
*/
|
||||
OpenLayers.Control.ArgParser = OpenLayers.Class.create();
|
||||
OpenLayers.Control.ArgParser.prototype =
|
||||
OpenLayers.Class.inherit( OpenLayers.Control, {
|
||||
|
||||
/** @type OpenLayers.LonLat */
|
||||
/**
|
||||
* Parameter: center
|
||||
* {<OpenLayers.LonLat>}
|
||||
*/
|
||||
center: null,
|
||||
|
||||
/** @type int */
|
||||
/**
|
||||
* Parameter: zoom
|
||||
* {int}
|
||||
*/
|
||||
zoom: null,
|
||||
|
||||
/** @type Array */
|
||||
/**
|
||||
* Parameter: layers
|
||||
* {Array}
|
||||
*/
|
||||
layers: null,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*
|
||||
* @param {Object} options
|
||||
* Constructor: OpenLayers.Control.ArgParser
|
||||
*
|
||||
* Parameters:
|
||||
* options - {Object}
|
||||
*/
|
||||
initialize: function(options) {
|
||||
OpenLayers.Control.prototype.initialize.apply(this, arguments);
|
||||
},
|
||||
|
||||
/** Set the map property for the control.
|
||||
/**
|
||||
* Method: setMap
|
||||
* Set the map property for the control.
|
||||
*
|
||||
* @param {OpenLayers.Map} map
|
||||
* Parameters:
|
||||
* map - {<OpenLayers.Map>}
|
||||
*/
|
||||
setMap: function(map) {
|
||||
OpenLayers.Control.prototype.setMap.apply(this, arguments);
|
||||
@@ -72,7 +88,9 @@ OpenLayers.Control.ArgParser.prototype =
|
||||
}
|
||||
},
|
||||
|
||||
/** As soon as a baseLayer has been loaded, we center and zoom
|
||||
/**
|
||||
* Method: setCenter
|
||||
* As soon as a baseLayer has been loaded, we center and zoom
|
||||
* ...and remove the handler.
|
||||
*/
|
||||
setCenter: function() {
|
||||
@@ -86,7 +104,9 @@ OpenLayers.Control.ArgParser.prototype =
|
||||
}
|
||||
},
|
||||
|
||||
/** As soon as all the layers are loaded, cycle through them and
|
||||
/**
|
||||
* Method: configureLayers
|
||||
* As soon as all the layers are loaded, cycle through them and
|
||||
* hide or show them.
|
||||
*/
|
||||
configureLayers: function() {
|
||||
|
||||
@@ -3,19 +3,29 @@
|
||||
* for the full text of the license. */
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/Control.js
|
||||
* @requires OpenLayers/Handler/Drag.js
|
||||
*
|
||||
* Class: OpenLayers.Control.DragPan
|
||||
* DragPan control.
|
||||
*
|
||||
* Inherits from:
|
||||
* - <OpenLayers.Control>
|
||||
*/
|
||||
OpenLayers.Control.DragPan = OpenLayers.Class.create();
|
||||
OpenLayers.Control.DragPan.prototype =
|
||||
OpenLayers.Class.inherit( OpenLayers.Control, {
|
||||
/** @type OpenLayers.Control.TYPES */
|
||||
|
||||
/**
|
||||
* Property: type
|
||||
* {OpenLayers.Control.TYPES}
|
||||
*/
|
||||
type: OpenLayers.Control.TYPE_TOOL,
|
||||
|
||||
/**
|
||||
*
|
||||
* Method: draw
|
||||
* Creates a Drag handler, using <OpenLayers.Control.PanMap.panMap> and
|
||||
* <OpenLayers.Control.PanMap.panMapDone> as callbacks.
|
||||
*/
|
||||
draw: function() {
|
||||
this.handler = new OpenLayers.Handler.Drag( this,
|
||||
@@ -23,7 +33,10 @@ OpenLayers.Control.DragPan.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Pixel} xy Pixel of the up position
|
||||
* Method: panMap
|
||||
*
|
||||
* Parameters:
|
||||
* xy - {<OpenLayers.Pixel>} Pixel of the up position
|
||||
*/
|
||||
panMap: function (xy) {
|
||||
var deltaX = this.handler.start.x - xy.x;
|
||||
@@ -39,7 +52,10 @@ OpenLayers.Control.DragPan.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Pixel} xy Pixel of the up position
|
||||
* Method: panMapDone
|
||||
*
|
||||
* Parameters:
|
||||
* xy - {<OpenLayers.Pixel>} Pixel of the up position
|
||||
*/
|
||||
panMapDone: function (xy) {
|
||||
var deltaX = this.handler.start.x - xy.x;
|
||||
|
||||
@@ -4,42 +4,50 @@
|
||||
|
||||
|
||||
/**
|
||||
* Draws features on a vector layer when active.
|
||||
*
|
||||
* @class
|
||||
* @requires OpenLayers/Control.js
|
||||
* @requires OpenLayers/Feature/Vector.js
|
||||
*
|
||||
* Class: OpenLayers.Control.DrawFeature
|
||||
* Draws features on a vector layer when active.
|
||||
*
|
||||
* Inherits from:
|
||||
* - <OpenLayers.Control>
|
||||
*/
|
||||
OpenLayers.Control.DrawFeature = OpenLayers.Class.create();
|
||||
OpenLayers.Control.DrawFeature.prototype =
|
||||
OpenLayers.Class.inherit(OpenLayers.Control, {
|
||||
|
||||
/**
|
||||
* @type OpenLayers.Layer.Vector
|
||||
* Property: layer
|
||||
* {<OpenLayers.Layer.Vector>}
|
||||
*/
|
||||
layer: null,
|
||||
|
||||
/**
|
||||
* @type {Object} The functions that are sent to the handler for callback
|
||||
* Property: callbacks
|
||||
* {Object} The functions that are sent to the handler for callback
|
||||
*/
|
||||
callbacks: null,
|
||||
|
||||
/**
|
||||
* @type {Function} Called after each feature is added
|
||||
* APIProperty: featureAdded
|
||||
* {Function} Called after each feature is added
|
||||
*/
|
||||
featureAdded: function() {},
|
||||
|
||||
/**
|
||||
* Used to set non-default properties on the control's handler
|
||||
*
|
||||
* @type Object
|
||||
* APIProperty: handlerOptions
|
||||
* {Object} Used to set non-default properties on the control's handler
|
||||
*/
|
||||
handlerOptions: null,
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Layer.Vector} layer
|
||||
* @param {OpenLayers.Handler} handler
|
||||
* @param {Object} options
|
||||
* Constructor: OpenLayers.Control.DrawFeature
|
||||
*
|
||||
* Parameters:
|
||||
* layer - {<OpenLayers.Layer.Vector>}
|
||||
* handler - {<OpenLayers.Handler>}
|
||||
* options - {Object}
|
||||
*/
|
||||
initialize: function(layer, handler, options) {
|
||||
OpenLayers.Control.prototype.initialize.apply(this, [options]);
|
||||
@@ -50,7 +58,7 @@ OpenLayers.Control.DrawFeature.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
* Method: drawFeature
|
||||
*/
|
||||
drawFeature: function(geometry) {
|
||||
var feature = new OpenLayers.Feature.Vector(geometry);
|
||||
|
||||
@@ -3,20 +3,24 @@
|
||||
* for the full text of the license. */
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/Control/Panel.js
|
||||
* @requires OpenLayers/Control/Navigation.js
|
||||
* @requires OpenLayers/Control/DrawFeature.js
|
||||
*
|
||||
* Class: OpenLayers.Control.EditingToolbar
|
||||
|
||||
*/
|
||||
OpenLayers.Control.EditingToolbar = OpenLayers.Class.create();
|
||||
OpenLayers.Control.EditingToolbar.prototype =
|
||||
OpenLayers.Class.inherit( OpenLayers.Control.Panel, {
|
||||
|
||||
/**
|
||||
* Constructor: OpenLayers.Control.EditingToolbar
|
||||
* Create an editing toolbar for a given layer.
|
||||
* @param {OpenLayers.Layer.Vector} layer
|
||||
* @param {Object} options
|
||||
*
|
||||
* Parameters:
|
||||
* layer - {<OpenLayers.Layer.Vector>}
|
||||
* options - {Object}
|
||||
*/
|
||||
initialize: function(layer, options) {
|
||||
OpenLayers.Control.Panel.prototype.initialize.apply(this, [options]);
|
||||
@@ -36,6 +40,7 @@ OpenLayers.Control.EditingToolbar.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: draw
|
||||
* calls the default draw, and then activates mouse defaults.
|
||||
*/
|
||||
draw: function() {
|
||||
|
||||
@@ -4,27 +4,33 @@
|
||||
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/Control.js
|
||||
* @requires OpenLayers/Handler/Keyboard.js
|
||||
*
|
||||
* Class: OpenLayers.Control.KeyboardDefaults
|
||||
*
|
||||
* Inherits from:
|
||||
* - <OpenLayers.Control>
|
||||
*/
|
||||
OpenLayers.Control.KeyboardDefaults = OpenLayers.Class.create();
|
||||
OpenLayers.Control.KeyboardDefaults.prototype =
|
||||
OpenLayers.Class.inherit( OpenLayers.Control, {
|
||||
|
||||
/** @type int */
|
||||
/**
|
||||
* APIProperty: slideFactor
|
||||
* Pixels to slide by.
|
||||
*/
|
||||
slideFactor: 75,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* Constructor: OpenLayers.Control.KeyboardDefaults
|
||||
*/
|
||||
initialize: function() {
|
||||
OpenLayers.Control.prototype.initialize.apply(this, arguments);
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
* APIMethod: destroy
|
||||
*/
|
||||
destroy: function() {
|
||||
if (this.handler) {
|
||||
@@ -36,7 +42,8 @@ OpenLayers.Control.KeyboardDefaults.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
* Method: draw
|
||||
* Create handler.
|
||||
*/
|
||||
draw: function() {
|
||||
this.handler = new OpenLayers.Handler.Keyboard( this, {
|
||||
@@ -45,8 +52,11 @@ OpenLayers.Control.KeyboardDefaults.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {Integer} code
|
||||
*/
|
||||
* Method: defaultKeyPress
|
||||
*
|
||||
* Parameters:
|
||||
* code - {Integer}
|
||||
*/
|
||||
defaultKeyPress: function (code) {
|
||||
switch(code) {
|
||||
case OpenLayers.Event.KEY_LEFT:
|
||||
|
||||
@@ -3,59 +3,93 @@
|
||||
* for the full text of the license. */
|
||||
|
||||
/**
|
||||
* @class
|
||||
* @requires OpenLayers/Control.js
|
||||
*
|
||||
* @requires OpenLayers/Control.js
|
||||
* @requires OpenLayers/Control.js
|
||||
* Class: OpenLayers.Control.LayerSwitcher
|
||||
*
|
||||
* Inherits from:
|
||||
* - <OpenLayers.Control>
|
||||
*/
|
||||
OpenLayers.Control.LayerSwitcher = OpenLayers.Class.create();
|
||||
OpenLayers.Control.LayerSwitcher.prototype =
|
||||
OpenLayers.Class.inherit( OpenLayers.Control, {
|
||||
|
||||
/** @type String */
|
||||
/**
|
||||
* Property: activeColor
|
||||
*/
|
||||
activeColor: "darkblue",
|
||||
|
||||
|
||||
// DOM Elements
|
||||
|
||||
/** @type DOMElement */
|
||||
/**
|
||||
* Property: layersDiv
|
||||
* {DOMElement}
|
||||
*/
|
||||
layersDiv: null,
|
||||
|
||||
/** @type DOMElement */
|
||||
/**
|
||||
* Property: baseLayersDiv
|
||||
* {DOMElement}
|
||||
*/
|
||||
baseLayersDiv: null,
|
||||
|
||||
/** @type Array */
|
||||
/**
|
||||
* Property: baseLayers
|
||||
* {Array}
|
||||
*/
|
||||
baseLayers: null,
|
||||
|
||||
|
||||
/** @type DOMElement */
|
||||
/**
|
||||
* Property: dataLbl
|
||||
* {DOMElement}
|
||||
*/
|
||||
dataLbl: null,
|
||||
|
||||
/** @type DOMElement */
|
||||
/**
|
||||
* Property: dataLayersDiv
|
||||
* {DOMElement}
|
||||
*/
|
||||
dataLayersDiv: null,
|
||||
|
||||
/** @type Array */
|
||||
/**
|
||||
* Property: dataLayers
|
||||
* {Array}
|
||||
*/
|
||||
dataLayers: null,
|
||||
|
||||
|
||||
/** @type DOMElement */
|
||||
/**
|
||||
* Property: minimizeDiv
|
||||
* {DOMElement}
|
||||
*/
|
||||
minimizeDiv: null,
|
||||
|
||||
/** @type DOMElement */
|
||||
/**
|
||||
* Property: maximizeDiv
|
||||
* {DOMElement}
|
||||
*/
|
||||
maximizeDiv: null,
|
||||
|
||||
/** @type Boolean */
|
||||
/**
|
||||
* APIProperty: ascending
|
||||
* {Boolean}
|
||||
*/
|
||||
ascending: true,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
* Constructor: OpenLayers.Control.LayerSwitcher
|
||||
*
|
||||
* Parameters:
|
||||
* options - {Object}
|
||||
*/
|
||||
initialize: function(options) {
|
||||
OpenLayers.Control.prototype.initialize.apply(this, arguments);
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
* APIMethod: destroy
|
||||
*/
|
||||
destroy: function() {
|
||||
|
||||
@@ -77,7 +111,10 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Map} map
|
||||
* Method: setMap
|
||||
*
|
||||
* Properties:
|
||||
* map - {<OpenLayers.Map>}
|
||||
*/
|
||||
setMap: function(map) {
|
||||
OpenLayers.Control.prototype.setMap.apply(this, arguments);
|
||||
@@ -89,8 +126,11 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @returns A reference to the DIV DOMElement containing the switcher tabs
|
||||
* @type DOMElement
|
||||
* Method: draw
|
||||
*
|
||||
* Returns:
|
||||
* {DOMElement} A reference to the DIV DOMElement containing the switcher
|
||||
* tabs
|
||||
*/
|
||||
draw: function() {
|
||||
OpenLayers.Control.prototype.draw.apply(this);
|
||||
@@ -109,12 +149,13 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
||||
return this.div;
|
||||
},
|
||||
|
||||
/** user specifies either "base" or "data". we then clear all the
|
||||
* corresponding listeners, the div, and reinitialize a new array.
|
||||
/**
|
||||
* Method: clearLayersArray
|
||||
* user specifies either "base" or "data". we then clear all the
|
||||
* corresponding listeners, the div, and reinitialize a new array.
|
||||
*
|
||||
* @private
|
||||
*
|
||||
* @param {String} layersType Ei
|
||||
* Parameters:
|
||||
* layersType - {String}
|
||||
*/
|
||||
clearLayersArray: function(layersType) {
|
||||
var layers = this[layersType + "Layers"];
|
||||
@@ -130,12 +171,14 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
||||
},
|
||||
|
||||
|
||||
/** Goes through and takes the current state of the Map and rebuilds the
|
||||
* control to display that state. Groups base layers into a radio-button
|
||||
* group and lists each data layer with a checkbox.
|
||||
*
|
||||
* @returns A reference to the DIV DOMElement containing the control
|
||||
* @type DOMElement
|
||||
/**
|
||||
* Method: redraw
|
||||
* Goes through and takes the current state of the Map and rebuilds the
|
||||
* control to display that state. Groups base layers into a radio-button
|
||||
* group and lists each data layer with a checkbox.
|
||||
*
|
||||
* Returns:
|
||||
* {DOMElement} A reference to the DIV DOMElement containing the control
|
||||
*/
|
||||
redraw: function() {
|
||||
|
||||
@@ -219,16 +262,17 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
||||
return this.div;
|
||||
},
|
||||
|
||||
/** A label has been clicked, check or uncheck its corresponding input
|
||||
/**
|
||||
* Method:
|
||||
* A label has been clicked, check or uncheck its corresponding input
|
||||
*
|
||||
* @private
|
||||
*
|
||||
* @context
|
||||
* {DOMElement} inputElem
|
||||
* {OpenLayers.Control.LayerSwitcher} layerSwitcher
|
||||
* {OpenLayers.Layer} layer
|
||||
*
|
||||
* @param {Event} e
|
||||
* Parameters:
|
||||
* e - {Event}
|
||||
*
|
||||
* Context:
|
||||
* - {DOMElement} inputElem
|
||||
* - {<OpenLayers.Control.LayerSwitcher>} layerSwitcher
|
||||
* - {<OpenLayers.Layer>} layer
|
||||
*/
|
||||
|
||||
onInputClick: function(e) {
|
||||
@@ -246,23 +290,24 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
||||
OpenLayers.Event.stop(e);
|
||||
},
|
||||
|
||||
/** Need to update the map accordingly whenever user clicks in either of
|
||||
* the layers.
|
||||
/**
|
||||
* Method:
|
||||
* Need to update the map accordingly whenever user clicks in either of
|
||||
* the layers.
|
||||
*
|
||||
* @private
|
||||
*
|
||||
* @param {Event} e
|
||||
* Parameters:
|
||||
* e - {Event}
|
||||
*/
|
||||
onLayerClick: function(e) {
|
||||
this.updateMap();
|
||||
},
|
||||
|
||||
|
||||
/** Cycles through the loaded data and base layer input arrays and makes
|
||||
/**
|
||||
* Method: updateMap
|
||||
* Cycles through the loaded data and base layer input arrays and makes
|
||||
* the necessary calls to the Map object such that that the map's
|
||||
* visual state corresponds to what the user has selected in the control
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
updateMap: function() {
|
||||
|
||||
@@ -282,9 +327,12 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
||||
|
||||
},
|
||||
|
||||
/** Set up the labels and divs for the control
|
||||
/**
|
||||
* Method: maximizeControl
|
||||
* Set up the labels and divs for the control
|
||||
*
|
||||
* @param {Event} e
|
||||
* Parameters:
|
||||
* e - {Event}
|
||||
*/
|
||||
maximizeControl: function(e) {
|
||||
|
||||
@@ -299,10 +347,13 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
||||
}
|
||||
},
|
||||
|
||||
/** Hide all the contents of the control, shrink the size,
|
||||
* add the maximize icon
|
||||
*
|
||||
* @param {Event} e
|
||||
/**
|
||||
* Method: minimizeControl
|
||||
* Hide all the contents of the control, shrink the size,
|
||||
* add the maximize icon
|
||||
*
|
||||
* Parameters:
|
||||
* e - {Event}
|
||||
*/
|
||||
minimizeControl: function(e) {
|
||||
|
||||
@@ -316,12 +367,13 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
||||
}
|
||||
},
|
||||
|
||||
/** Hide/Show all LayerSwitcher controls depending on whether we are
|
||||
/**
|
||||
* Method: showControls
|
||||
* Hide/Show all LayerSwitcher controls depending on whether we are
|
||||
* minimized or not
|
||||
*
|
||||
* @private
|
||||
*
|
||||
* @param {Boolean} minimize
|
||||
* Parameters:
|
||||
* minimize - {Boolean}
|
||||
*/
|
||||
showControls: function(minimize) {
|
||||
|
||||
@@ -331,8 +383,9 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
||||
this.layersDiv.style.display = minimize ? "none" : "";
|
||||
},
|
||||
|
||||
/** Set up the labels and divs for the control
|
||||
*
|
||||
/**
|
||||
* Method: loadContents
|
||||
* Set up the labels and divs for the control
|
||||
*/
|
||||
loadContents: function() {
|
||||
|
||||
@@ -460,33 +513,36 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @private
|
||||
*
|
||||
* @param {Event} evt
|
||||
* Method: ignoreEvent
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {Event}
|
||||
*/
|
||||
ignoreEvent: function(evt) {
|
||||
OpenLayers.Event.stop(evt);
|
||||
},
|
||||
|
||||
/** Register a local 'mouseDown' flag so that we'll know whether or not
|
||||
/**
|
||||
* Method: mouseDown
|
||||
* Register a local 'mouseDown' flag so that we'll know whether or not
|
||||
* to ignore a mouseUp event
|
||||
*
|
||||
* @private
|
||||
*
|
||||
* @param {Event} evt
|
||||
* Parameters:
|
||||
* evt - {Event}
|
||||
*/
|
||||
mouseDown: function(evt) {
|
||||
this.mouseDown = true;
|
||||
this.ignoreEvent(evt);
|
||||
},
|
||||
|
||||
/** If the 'mouseDown' flag has been set, that means that the drag was
|
||||
/**
|
||||
* Method: mouseUp
|
||||
* If the 'mouseDown' flag has been set, that means that the drag was
|
||||
* started from within the LayerSwitcher control, and thus we can
|
||||
* ignore the mouseup. Otherwise, let the Event continue.
|
||||
*
|
||||
* @private
|
||||
*
|
||||
* @param {Event} evt
|
||||
* Parameters:
|
||||
* evt - {Event}
|
||||
*/
|
||||
mouseUp: function(evt) {
|
||||
if (this.mouseDown) {
|
||||
|
||||
@@ -3,9 +3,12 @@
|
||||
* for the full text of the license. */
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/Control.js
|
||||
*
|
||||
* Class: OpenLayers.Control.MouseDefaults
|
||||
*
|
||||
* Inherits from:
|
||||
* - <OpenLayers.Control>
|
||||
*/
|
||||
OpenLayers.Control.MouseDefaults = OpenLayers.Class.create();
|
||||
OpenLayers.Control.MouseDefaults.prototype =
|
||||
@@ -15,21 +18,27 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
This class is DEPRECATED in 2.4 and will be removed by 3.0.
|
||||
If you need this functionality, use Control.Navigation instead!!! */
|
||||
|
||||
/** @type Boolean */
|
||||
/**
|
||||
* Property: performedDrag
|
||||
* {Boolean}
|
||||
*/
|
||||
performedDrag: false,
|
||||
|
||||
/** @type function */
|
||||
/**
|
||||
* Property: wheelObserver
|
||||
* {Function}
|
||||
*/
|
||||
wheelObserver: null,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* Constructor: OpenLayers.Control.MouseDefaults
|
||||
*/
|
||||
initialize: function() {
|
||||
OpenLayers.Control.prototype.initialize.apply(this, arguments);
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
* APIMethod: destroy
|
||||
*/
|
||||
destroy: function() {
|
||||
|
||||
@@ -58,7 +67,7 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
* Method: draw
|
||||
*/
|
||||
draw: function() {
|
||||
this.map.events.register( "click", this, this.defaultClick );
|
||||
@@ -73,7 +82,7 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
* Method: registerWheelEvents
|
||||
*/
|
||||
registerWheelEvents: function() {
|
||||
|
||||
@@ -86,9 +95,13 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {Event} evt
|
||||
* Method: defaultClick
|
||||
*
|
||||
* @type Boolean
|
||||
* Parameters:
|
||||
* evt - {Event}
|
||||
*
|
||||
* Returns:
|
||||
* {Boolean}
|
||||
*/
|
||||
defaultClick: function (evt) {
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
@@ -98,7 +111,10 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {Event} evt
|
||||
* Method: defaultDblClick
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {Event}
|
||||
*/
|
||||
defaultDblClick: function (evt) {
|
||||
var newCenter = this.map.getLonLatFromViewPortPx( evt.xy );
|
||||
@@ -108,7 +124,10 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {Event} evt
|
||||
* Method: defaultMouseDown
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {Event}
|
||||
*/
|
||||
defaultMouseDown: function (evt) {
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
@@ -134,7 +153,10 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {Event} evt
|
||||
* Method: defaultMouseMove
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {Event}
|
||||
*/
|
||||
defaultMouseMove: function (evt) {
|
||||
// record the mouse position, used in onWheelEvent
|
||||
@@ -168,7 +190,10 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {Event} evt
|
||||
* Method: defaultMouseUp
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {<OpenLayers.Event>}
|
||||
*/
|
||||
defaultMouseUp: function (evt) {
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
@@ -185,7 +210,10 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {Event} evt
|
||||
* Method: defaultMouseOut
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {Event}
|
||||
*/
|
||||
defaultMouseOut: function (evt) {
|
||||
if (this.mouseDragStart != null &&
|
||||
@@ -198,7 +226,9 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
},
|
||||
|
||||
|
||||
/** User spun scroll wheel up
|
||||
/**
|
||||
* Method: defaultWheelUp
|
||||
* User spun scroll wheel up
|
||||
*
|
||||
*/
|
||||
defaultWheelUp: function(evt) {
|
||||
@@ -208,8 +238,9 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
}
|
||||
},
|
||||
|
||||
/** User spun scroll wheel down
|
||||
*
|
||||
/**
|
||||
* Method: defaultWheelDown
|
||||
* User spun scroll wheel down
|
||||
*/
|
||||
defaultWheelDown: function(evt) {
|
||||
if (this.map.getZoom() > 0) {
|
||||
@@ -218,8 +249,9 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
}
|
||||
},
|
||||
|
||||
/** Zoombox function.
|
||||
*
|
||||
/**
|
||||
* Method: zoomBoxEnd
|
||||
* Zoombox function.
|
||||
*/
|
||||
zoomBoxEnd: function(evt) {
|
||||
if (this.mouseDragStart != null) {
|
||||
@@ -245,6 +277,7 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: removeZoomBox
|
||||
* Remove the zoombox from the screen and nullify our reference to it.
|
||||
*/
|
||||
removeZoomBox: function() {
|
||||
@@ -258,9 +291,12 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
*/
|
||||
|
||||
|
||||
/** Catch the wheel event and handle it xbrowserly
|
||||
*
|
||||
* @param {Event} e
|
||||
/**
|
||||
* Method: onWheelEvent
|
||||
* Catch the wheel event and handle it xbrowserly
|
||||
*
|
||||
* Parameters:
|
||||
* e - {Event}
|
||||
*/
|
||||
onWheelEvent: function(e){
|
||||
|
||||
|
||||
@@ -4,46 +4,68 @@
|
||||
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/Control.js
|
||||
*
|
||||
* Class: OpenLayers.Control.MousePosition
|
||||
*/
|
||||
OpenLayers.Control.MousePosition = OpenLayers.Class.create();
|
||||
OpenLayers.Control.MousePosition.prototype =
|
||||
OpenLayers.Class.inherit( OpenLayers.Control, {
|
||||
|
||||
/** @type DOMElement */
|
||||
/**
|
||||
* Property: element
|
||||
* {DOMElement}
|
||||
*/
|
||||
element: null,
|
||||
|
||||
/** @type String */
|
||||
/**
|
||||
* APIProperty: prefix
|
||||
*/
|
||||
prefix: '',
|
||||
|
||||
/** @type String */
|
||||
/**
|
||||
* APIProperty: seperator
|
||||
* {String}
|
||||
*/
|
||||
separator: ', ',
|
||||
|
||||
/** @type String */
|
||||
/**
|
||||
* APIProperty: suffix
|
||||
* {String}
|
||||
*/
|
||||
suffix: '',
|
||||
|
||||
/** @type int */
|
||||
/**
|
||||
* APIProperty: numDigits
|
||||
* {Integer}
|
||||
*/
|
||||
numdigits: 5,
|
||||
|
||||
/** @type int */
|
||||
/**
|
||||
* APIProperty: granularity
|
||||
* {Integer}
|
||||
*/
|
||||
granularity: 10,
|
||||
|
||||
/** @type OpenLayers.LonLat */
|
||||
/**
|
||||
* Property: lastXy
|
||||
* {<OpenLayers.LonLat>}
|
||||
*/
|
||||
lastXy: null,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* Constructor: OpenLayers.Control.MousePosition
|
||||
*
|
||||
* @param {DOMElement} options Options for control.
|
||||
* Parameters:
|
||||
* options - {DOMElement} Options for control.
|
||||
*/
|
||||
initialize: function(options) {
|
||||
OpenLayers.Control.prototype.initialize.apply(this, arguments);
|
||||
},
|
||||
|
||||
/**
|
||||
* @type DOMElement
|
||||
* Method: draw
|
||||
* {DOMElement}
|
||||
*/
|
||||
draw: function() {
|
||||
OpenLayers.Control.prototype.draw.apply(this, arguments);
|
||||
@@ -60,7 +82,7 @@ OpenLayers.Control.MousePosition.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
* Method: redraw
|
||||
*/
|
||||
redraw: function(evt) {
|
||||
|
||||
@@ -95,7 +117,7 @@ OpenLayers.Control.MousePosition.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
* Method: setMap
|
||||
*/
|
||||
setMap: function() {
|
||||
OpenLayers.Control.prototype.setMap.apply(this, arguments);
|
||||
|
||||
@@ -4,10 +4,12 @@
|
||||
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/Control.js
|
||||
* @requires OpenLayers/Control/MouseDefaults.js
|
||||
*
|
||||
* Class: OpenLayers.Control.MouseToolbar
|
||||
* This class is DEPRECATED in 2.4 and will be removed by 3.0.
|
||||
* If you need this functionality, use Control.NavToolbar instead!!!
|
||||
*/
|
||||
OpenLayers.Control.MouseToolbar = OpenLayers.Class.create();
|
||||
OpenLayers.Control.MouseToolbar.X = 6;
|
||||
@@ -15,19 +17,34 @@ OpenLayers.Control.MouseToolbar.Y = 300;
|
||||
OpenLayers.Control.MouseToolbar.prototype =
|
||||
OpenLayers.Class.inherit( OpenLayers.Control.MouseDefaults, {
|
||||
|
||||
/** WARNING WARNING WARNING!!!
|
||||
This class is DEPRECATED in 2.4 and will be removed by 3.0.
|
||||
If you need this functionality, use Control.NavToolbar instead!!! */
|
||||
|
||||
/**
|
||||
* Property: mode
|
||||
*/
|
||||
mode: null,
|
||||
|
||||
/**
|
||||
* Property: buttons
|
||||
*/
|
||||
buttons: null,
|
||||
|
||||
|
||||
/**
|
||||
* APIProperty: direction
|
||||
* {String} 'vertical' or 'horizontal'
|
||||
*/
|
||||
direction: "vertical",
|
||||
|
||||
/** @type String */
|
||||
/**
|
||||
* Property: buttonClicked
|
||||
* {String}
|
||||
*/
|
||||
buttonClicked: null,
|
||||
|
||||
/**
|
||||
* Constructor: OpenLayers.Control.MouseToolbar
|
||||
*
|
||||
* Parameters:
|
||||
* position - {<OpenLayers.Pixel>}
|
||||
* direction - {String}
|
||||
*/
|
||||
initialize: function(position, direction) {
|
||||
OpenLayers.Control.prototype.initialize.apply(this, arguments);
|
||||
this.position = new OpenLayers.Pixel(OpenLayers.Control.MouseToolbar.X,
|
||||
@@ -42,7 +59,7 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
* APIMethod: destroy
|
||||
*/
|
||||
destroy: function() {
|
||||
for( var btnId in this.buttons) {
|
||||
@@ -54,6 +71,9 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
arguments);
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: draw
|
||||
*/
|
||||
draw: function() {
|
||||
OpenLayers.Control.prototype.draw.apply(this, arguments);
|
||||
OpenLayers.Control.MouseDefaults.prototype.draw.apply(this, arguments);
|
||||
@@ -68,7 +88,10 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
|
||||
return this.div;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Method: _addButton
|
||||
*/
|
||||
_addButton:function(id, img, activeImg, xy, sz, title) {
|
||||
var imgLocation = OpenLayers.Util.getImagesLocation() + img;
|
||||
var activeImgLocation = OpenLayers.Util.getImagesLocation() + activeImg;
|
||||
@@ -97,7 +120,10 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {Event} evt
|
||||
* Method: buttonDown
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {Event}
|
||||
*/
|
||||
buttonDown: function(evt) {
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
@@ -106,7 +132,10 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {Event} evt
|
||||
* Method: buttonUp
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {Event}
|
||||
*/
|
||||
buttonUp: function(evt) {
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
@@ -120,8 +149,11 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {Event} evt
|
||||
*/
|
||||
* Method: defaultDblClick
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {Event}
|
||||
*/
|
||||
defaultDblClick: function (evt) {
|
||||
this.switchModeTo("pan");
|
||||
this.performedDrag = false;
|
||||
@@ -132,8 +164,11 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {Event} evt
|
||||
*/
|
||||
* Method: defaultMouseDown
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {Event}
|
||||
*/
|
||||
defaultMouseDown: function (evt) {
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
this.mouseDragStart = evt.xy.clone();
|
||||
@@ -214,6 +249,12 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
OpenLayers.Event.stop(evt);
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: switchModeTo
|
||||
*
|
||||
* Parameters:
|
||||
* mode - {String}
|
||||
*/
|
||||
switchModeTo: function(mode) {
|
||||
if (mode != this.mode) {
|
||||
|
||||
@@ -246,13 +287,19 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: leaveMode
|
||||
*/
|
||||
leaveMode: function() {
|
||||
this.switchModeTo("pan");
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {Event} evt
|
||||
*/
|
||||
* Method: defaultMouseMove
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {Event}
|
||||
*/
|
||||
defaultMouseMove: function (evt) {
|
||||
if (this.mouseDragStart != null) {
|
||||
switch (this.mode) {
|
||||
@@ -283,8 +330,11 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {Event} evt
|
||||
*/
|
||||
* Method: defaultMouseUp
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {Event}
|
||||
*/
|
||||
defaultMouseUp: function (evt) {
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
switch (this.mode) {
|
||||
@@ -303,8 +353,11 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {Event} evt
|
||||
*/
|
||||
* Method: defaultMouseOut
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {Event}
|
||||
*/
|
||||
defaultMouseOut: function (evt) {
|
||||
if (this.mouseDragStart != null
|
||||
&& OpenLayers.Util.mouseLeft(evt, this.map.div)) {
|
||||
@@ -317,6 +370,12 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: defaultClick
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {Event}
|
||||
*/
|
||||
defaultClick: function (evt) {
|
||||
if (this.performedDrag) {
|
||||
this.performedDrag = false;
|
||||
|
||||
@@ -3,17 +3,18 @@
|
||||
* for the full text of the license. */
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/Control/Panel.js
|
||||
* @requires OpenLayers/Control/Navigation.js
|
||||
* @requires OpenLayers/Control/ZoomBox.js
|
||||
*
|
||||
* Class: OpenLayers.Control.NavToolbar
|
||||
*/
|
||||
OpenLayers.Control.NavToolbar = OpenLayers.Class.create();
|
||||
OpenLayers.Control.NavToolbar.prototype =
|
||||
OpenLayers.Class.inherit( OpenLayers.Control.Panel, {
|
||||
|
||||
/**
|
||||
* Constructor: OpenLayers.Control.NavToolbar
|
||||
* Add our two mousedefaults controls.
|
||||
*/
|
||||
initialize: function(options) {
|
||||
@@ -25,6 +26,7 @@ OpenLayers.Control.NavToolbar.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: draw
|
||||
* calls the default draw, and then activates mouse defaults.
|
||||
*/
|
||||
draw: function() {
|
||||
|
||||
@@ -3,25 +3,37 @@
|
||||
* for the full text of the license. */
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/Control/ZoomBox.js
|
||||
* @requires OpenLayers/Control/DragPan.js
|
||||
* @requires OpenLayers/Handler/MouseWheel.js
|
||||
*
|
||||
* Class: OpenLayers.Control.Navigation
|
||||
*/
|
||||
OpenLayers.Control.Navigation = OpenLayers.Class.create();
|
||||
OpenLayers.Control.Navigation.prototype =
|
||||
OpenLayers.Class.inherit( OpenLayers.Control, {
|
||||
|
||||
/** @type OpenLayers.Control.ZoomBox */
|
||||
/**
|
||||
* Property: dragPan
|
||||
* {<OpenLayers.Control.ZoomBox>}
|
||||
*/
|
||||
dragPan: null,
|
||||
|
||||
/** @type OpenLayers.Control.ZoomBox */
|
||||
/**
|
||||
* Property: zoomBox
|
||||
* {<OpenLayers.Control.ZoomBox>}
|
||||
*/
|
||||
zoomBox: null,
|
||||
|
||||
/** @type OpenLayers.Handler.MouseWheel */
|
||||
/**
|
||||
* Property: wheelHandler
|
||||
* {<OpenLayers.Handler.MouseWheel>}
|
||||
*/
|
||||
wheelHandler: null,
|
||||
|
||||
/**
|
||||
* Method: activate
|
||||
*/
|
||||
activate: function() {
|
||||
this.dragPan.activate();
|
||||
this.wheelHandler.activate();
|
||||
@@ -29,6 +41,9 @@ OpenLayers.Control.Navigation.prototype =
|
||||
return OpenLayers.Control.prototype.activate.apply(this,arguments);
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: deactivate
|
||||
*/
|
||||
deactivate: function() {
|
||||
this.zoomBox.deactivate();
|
||||
this.dragPan.deactivate();
|
||||
@@ -36,6 +51,9 @@ OpenLayers.Control.Navigation.prototype =
|
||||
return OpenLayers.Control.prototype.deactivate.apply(this,arguments);
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: draw
|
||||
*/
|
||||
draw: function() {
|
||||
this.map.events.register( "dblclick", this, this.defaultDblClick );
|
||||
this.dragPan = new OpenLayers.Control.DragPan({map: this.map});
|
||||
@@ -50,8 +68,11 @@ OpenLayers.Control.Navigation.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {Event} evt
|
||||
*/
|
||||
* Method: defaultDblClick
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {Event}
|
||||
*/
|
||||
defaultDblClick: function (evt) {
|
||||
var newCenter = this.map.getLonLatFromViewPortPx( evt.xy );
|
||||
this.map.setCenter(newCenter, this.map.zoom + 1);
|
||||
@@ -59,6 +80,12 @@ OpenLayers.Control.Navigation.prototype =
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: wheelChange
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {Event}
|
||||
*/
|
||||
wheelChange: function(evt, deltaZ) {
|
||||
var newZoom = this.map.getZoom() + deltaZ;
|
||||
if (!this.map.isValidZoomLevel(newZoom)) return;
|
||||
@@ -74,15 +101,23 @@ OpenLayers.Control.Navigation.prototype =
|
||||
this.map.setCenter( newCenter, newZoom );
|
||||
},
|
||||
|
||||
/** User spun scroll wheel up
|
||||
/**
|
||||
* Method: wheelUp
|
||||
* User spun scroll wheel up
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {Event}
|
||||
*/
|
||||
wheelUp: function(evt) {
|
||||
this.wheelChange(evt, 1);
|
||||
},
|
||||
|
||||
/** User spun scroll wheel down
|
||||
/**
|
||||
* Method: wheelDown
|
||||
* User spun scroll wheel down
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {Event}
|
||||
*/
|
||||
wheelDown: function(evt) {
|
||||
this.wheelChange(evt, -1);
|
||||
|
||||
@@ -1,78 +1,88 @@
|
||||
/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
|
||||
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
|
||||
* for the full text of the license. */
|
||||
/**
|
||||
* @fileoverview Locator Map Control
|
||||
* @author Tim Schaub
|
||||
*/
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/Control.js
|
||||
* @requires OpenLayers/BaseTypes.js
|
||||
* @requires OpenLayers/Events.js
|
||||
*
|
||||
* Class: OpenLayers.Control.OverviewMap
|
||||
* Create an overview map to display the extent of your main map and provide
|
||||
* additional navigation control. Create a new overview map with the
|
||||
* <OpenLayers.Control.OverviewMap> constructor.
|
||||
*
|
||||
* Inerits from:
|
||||
* - <OpenLayers.Control>
|
||||
*/
|
||||
OpenLayers.Control.OverviewMap = OpenLayers.Class.create();
|
||||
|
||||
OpenLayers.Control.OverviewMap.prototype =
|
||||
OpenLayers.Class.inherit( OpenLayers.Control, {
|
||||
|
||||
/** For div.id
|
||||
* @type String */
|
||||
/**
|
||||
* Property: id
|
||||
* {String} For div.id
|
||||
*/
|
||||
id: "OverviewMap",
|
||||
|
||||
/** @type DOMElement */
|
||||
/**
|
||||
* Property: element
|
||||
* {DOMElement} The DOM element that contains the overview map
|
||||
*/
|
||||
element: null,
|
||||
|
||||
/**
|
||||
* The overvew map itself.
|
||||
* @type OpenLayers.Map
|
||||
* APIProperty: ovmap
|
||||
* {<OpenLayers.Map>} A reference to the overvew map itself.
|
||||
*/
|
||||
ovmap: null,
|
||||
|
||||
/**
|
||||
* The overvew map size in pixels. Note that this is the size of the map
|
||||
* itself - the element that contains the map (default class name
|
||||
* olControlOverviewMapElement) may have padding or other style attributes
|
||||
* added via CSS.
|
||||
* @type OpenLayers.Size
|
||||
* APIProperty: size
|
||||
* {<OpenLayers.Size>} The overvew map size in pixels. Note that this is
|
||||
* the size of the map itself - the element that contains the map (default
|
||||
* class name olControlOverviewMapElement) may have padding or other style
|
||||
* attributes added via CSS.
|
||||
*/
|
||||
size: new OpenLayers.Size(180, 90),
|
||||
|
||||
/**
|
||||
* Ordered list of layers in the overview map. If none are sent at
|
||||
* construction, then the default below is used.
|
||||
*
|
||||
* @type Array(OpenLayers.Layer)
|
||||
* APIProperty: layers
|
||||
* {Array(<OpenLayers.Layer>)} Ordered list of layers in the overview map.
|
||||
* If none are sent at construction, the base layer for the main map is used.
|
||||
*/
|
||||
layers: null,
|
||||
|
||||
/**
|
||||
* The ratio of the overview map resolution to the main map resolution
|
||||
* at which to zoom farther out on the overview map.
|
||||
* @type Float
|
||||
* APIProperty: minRatio
|
||||
* {Numver} The ratio of the overview map resolution to the main map
|
||||
* resolution at which to zoom farther out on the overview map.
|
||||
*/
|
||||
minRatio: 8,
|
||||
|
||||
/**
|
||||
* The ratio of the overview map resolution to the main map resolution
|
||||
* at which to zoom farther in on the overview map.
|
||||
* @type Float
|
||||
* APIProperty: maxRatio
|
||||
* {Float} The ratio of the overview map resolution to the main map
|
||||
* resolution at which to zoom farther in on the overview map.
|
||||
*/
|
||||
maxRatio: 32,
|
||||
|
||||
/**
|
||||
* An object containing any non-default properties to be sent to the
|
||||
* overview map's map constructor. These should include any non-default
|
||||
* APIProperty: mapOptions
|
||||
* {Object} An object containing any non-default properties to be sent to
|
||||
* the overview map's map constructor. These should include any non-default
|
||||
* options that the main map was constructed with.
|
||||
* @type: Object
|
||||
*/
|
||||
mapOptions: null,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @param {Object} options Hashtable of options to set on the overview map
|
||||
* Constructor: OpenLayers.Control.OverviewMap
|
||||
* Create a new overview map
|
||||
*
|
||||
* Parameters:
|
||||
* object - {Object} Properties of this object will be set on the overview
|
||||
* map object. Note, to set options on the map object contained in this
|
||||
* control, set <mapOptions> as one of the options properties.
|
||||
*/
|
||||
initialize: function(options) {
|
||||
this.layers = new Array();
|
||||
@@ -80,7 +90,8 @@ OpenLayers.Control.OverviewMap.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
* APIMethod: destroy
|
||||
* Deconstruct the control
|
||||
*/
|
||||
destroy: function() {
|
||||
if (!this.mapDiv) { // we've already been destroyed
|
||||
@@ -124,7 +135,8 @@ OpenLayers.Control.OverviewMap.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @type DOMElement
|
||||
* Method: draw
|
||||
* Render the control in the browser.
|
||||
*/
|
||||
draw: function() {
|
||||
OpenLayers.Control.prototype.draw.apply(this, arguments);
|
||||
@@ -249,14 +261,22 @@ OpenLayers.Control.OverviewMap.prototype =
|
||||
return this.div;
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: baseLayerDraw
|
||||
* Draw the base layer - called if unable to complete in the initial draw
|
||||
*/
|
||||
baseLayerDraw: function() {
|
||||
this.draw();
|
||||
this.map.events.unregister("changebaselayer", this, this.baseLayerDraw);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Event} evt
|
||||
*/
|
||||
* Method: rectMouseOut
|
||||
* Handle browser events
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {<OpenLayers.Event>} evt
|
||||
*/
|
||||
rectMouseOut: function (evt) {
|
||||
if(this.rectDragStart != null) {
|
||||
if(this.performedRectDrag) {
|
||||
@@ -278,8 +298,12 @@ OpenLayers.Control.OverviewMap.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Event} evt
|
||||
*/
|
||||
* Method: rectMouseDown
|
||||
* Handle browser events
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {<OpenLayers.Event>} evt
|
||||
*/
|
||||
rectMouseDown: function (evt) {
|
||||
if(!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
this.rectDragStart = evt.xy.clone();
|
||||
@@ -288,8 +312,12 @@ OpenLayers.Control.OverviewMap.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Event} evt
|
||||
*/
|
||||
* Method: rectMouseMove
|
||||
* Handle browser events
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {<OpenLayers.Event>} evt
|
||||
*/
|
||||
rectMouseMove: function(evt) {
|
||||
if(this.rectDragStart != null) {
|
||||
var deltaX = this.rectDragStart.x - evt.xy.x;
|
||||
@@ -317,8 +345,12 @@ OpenLayers.Control.OverviewMap.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Event} evt
|
||||
*/
|
||||
* Method: rectMouseUp
|
||||
* Handle browser events
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {<OpenLayers.Event>} evt
|
||||
*/
|
||||
rectMouseUp: function(evt) {
|
||||
if(!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
if(this.performedRectDrag) {
|
||||
@@ -330,8 +362,12 @@ OpenLayers.Control.OverviewMap.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Event} evt
|
||||
*/
|
||||
* Method: rectDblClick
|
||||
* Handle browser events
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {<OpenLayers.Event>} evt
|
||||
*/
|
||||
rectDblClick: function(evt) {
|
||||
this.performedRectDrag = false;
|
||||
OpenLayers.Event.stop(evt);
|
||||
@@ -339,8 +375,12 @@ OpenLayers.Control.OverviewMap.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Event} evt
|
||||
*/
|
||||
* Method: mapDivClick
|
||||
* Handle browser events
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {<OpenLayers.Event>} evt
|
||||
*/
|
||||
mapDivClick: function(evt) {
|
||||
var pxBounds = this.getRectPxBounds();
|
||||
var pxCenter = pxBounds.getCenterPixel();
|
||||
@@ -362,9 +402,12 @@ OpenLayers.Control.OverviewMap.prototype =
|
||||
OpenLayers.Event.stop(evt);
|
||||
},
|
||||
|
||||
/** Set up the labels and divs for the control
|
||||
*
|
||||
* @param {OpenLayers.Event} e
|
||||
/**
|
||||
* Method: maximizeControl
|
||||
* Unhide the control. Called when the control is in the map viewport.
|
||||
*
|
||||
* Parameters:
|
||||
* e - {<OpenLayers.Event>}
|
||||
*/
|
||||
maximizeControl: function(e) {
|
||||
this.element.style.display = '';
|
||||
@@ -374,10 +417,13 @@ OpenLayers.Control.OverviewMap.prototype =
|
||||
}
|
||||
},
|
||||
|
||||
/** Hide all the contents of the control, shrink the size,
|
||||
* add the maximize icon
|
||||
/**
|
||||
* Method: minimizeControl
|
||||
* Hide all the contents of the control, shrink the size,
|
||||
* add the maximize icon
|
||||
*
|
||||
* @param {OpenLayers.Event} e
|
||||
* Parameters:
|
||||
* e - {<OpenLayers.Event>}
|
||||
*/
|
||||
minimizeControl: function(e) {
|
||||
this.element.style.display = 'none';
|
||||
@@ -387,12 +433,12 @@ OpenLayers.Control.OverviewMap.prototype =
|
||||
}
|
||||
},
|
||||
|
||||
/** Hide/Show all LayerSwitcher controls depending on whether we are
|
||||
* minimized or not
|
||||
*
|
||||
* @private
|
||||
*
|
||||
* @param {Boolean} minimize
|
||||
/**
|
||||
* Method: showToggle
|
||||
* Hide/Show the toggle depending on whether the control is minimized
|
||||
*
|
||||
* Parameters:
|
||||
* minimize - {Boolean}
|
||||
*/
|
||||
showToggle: function(minimize) {
|
||||
this.maximizeDiv.style.display = minimize ? '' : 'none';
|
||||
@@ -400,6 +446,7 @@ OpenLayers.Control.OverviewMap.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: update
|
||||
* Update the overview map after layers move.
|
||||
*/
|
||||
update: function() {
|
||||
@@ -416,6 +463,7 @@ OpenLayers.Control.OverviewMap.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: isSuitableOverview
|
||||
* Determines if the overview map is suitable given the extent and
|
||||
* resolution of the main map.
|
||||
*/
|
||||
@@ -433,6 +481,10 @@ OpenLayers.Control.OverviewMap.prototype =
|
||||
(this.ovmap.getExtent().containsBounds(testExtent)));
|
||||
},
|
||||
|
||||
/**
|
||||
* Method updateOverview
|
||||
* Called by <update> if <isSuitableOverview> returns true
|
||||
*/
|
||||
updateOverview: function() {
|
||||
var mapRes = this.map.getResolution();
|
||||
var targetRes = this.ovmap.getResolution();
|
||||
@@ -449,6 +501,10 @@ OpenLayers.Control.OverviewMap.prototype =
|
||||
this.updateRectToMap();
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: createMap
|
||||
* Construct the map that this control contains
|
||||
*/
|
||||
createMap: function() {
|
||||
// create the overview map
|
||||
var options = OpenLayers.Util.extend(
|
||||
@@ -470,6 +526,7 @@ OpenLayers.Control.OverviewMap.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: updateRectToMap
|
||||
* Updates the extent rectangle position and size to match the map extent
|
||||
*/
|
||||
updateRectToMap: function() {
|
||||
@@ -487,6 +544,7 @@ OpenLayers.Control.OverviewMap.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: updateMapToRect
|
||||
* Updates the map extent to match the extent rectangle position and size
|
||||
*/
|
||||
updateMapToRect: function() {
|
||||
@@ -496,9 +554,12 @@ OpenLayers.Control.OverviewMap.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: getRectPxBounds
|
||||
* Get extent rectangle pixel bounds
|
||||
* @returns An OpenLayers.Bounds wich is the extent rectangle's pixel
|
||||
* bounds (relative to the parent element)
|
||||
*
|
||||
* Return:
|
||||
* {<OpenLayers.Bounds>} A bounds which is the extent rectangle's pixel
|
||||
* bounds (relative to the parent element)
|
||||
*/
|
||||
getRectPxBounds: function() {
|
||||
var top = parseInt(this.extentRectangle.style.top);
|
||||
@@ -509,8 +570,11 @@ OpenLayers.Control.OverviewMap.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* Set extent rectangle pixel bounds.
|
||||
* @param {OpenLayers.Bounds} pxBounds
|
||||
* Method: setRectPxBounds
|
||||
* Set extent rectangle pixel bounds.
|
||||
*
|
||||
* Parameters:
|
||||
* pxBounds - {<OpenLayers.Bounds>}
|
||||
*/
|
||||
setRectPxBounds: function(pxBounds) {
|
||||
var top = Math.max(pxBounds.top, 0);
|
||||
@@ -526,12 +590,16 @@ OpenLayers.Control.OverviewMap.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Bounds} lonLatBounds
|
||||
*
|
||||
* @returns An OpenLayers.Bounds which is the passed-in map lon/lat extent
|
||||
* translated into pixel bounds for the overview map
|
||||
* @type OpenLayers.Bounds
|
||||
*/
|
||||
* Method: getRectBoundsFromMapBounds
|
||||
* Get the rect bounds from the map bounds.
|
||||
*
|
||||
* Parameters:
|
||||
* lonLatBounds - {<OpenLayers.Bounds>}
|
||||
*
|
||||
* Return:
|
||||
* {<OpenLayers.Bounds>}A bounds which is the passed-in map lon/lat extent
|
||||
* translated into pixel bounds for the overview map
|
||||
*/
|
||||
getRectBoundsFromMapBounds: function(lonLatBounds) {
|
||||
var leftBottomLonLat = new OpenLayers.LonLat(lonLatBounds.left,
|
||||
lonLatBounds.bottom);
|
||||
@@ -548,12 +616,16 @@ OpenLayers.Control.OverviewMap.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Bounds} pxBounds
|
||||
*
|
||||
* @returns An OpenLayers.Bounds which is the passed-in overview rect bounds
|
||||
* translated into lon/lat bounds for the overview map
|
||||
* @type OpenLayers.Bounds
|
||||
*/
|
||||
* Method: getMapBoundsFromRectBounds
|
||||
* Get the map bounds from the rect bounds.
|
||||
*
|
||||
* Parameters:
|
||||
* pxBounds - {<OpenLayers.Bounds>}
|
||||
*
|
||||
* Return:
|
||||
* {<OpenLayers.Bounds>} Bounds which is the passed-in overview rect bounds
|
||||
* translated into lon/lat bounds for the overview map
|
||||
*/
|
||||
getMapBoundsFromRectBounds: function(pxBounds) {
|
||||
var leftBottomPx = new OpenLayers.Pixel(pxBounds.left,
|
||||
pxBounds.bottom);
|
||||
@@ -566,12 +638,16 @@ OpenLayers.Control.OverviewMap.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Pixel} overviewMapPx
|
||||
*
|
||||
* @returns An OpenLayers.LonLat which is the passed-in overview map
|
||||
* OpenLayers.Pixel, translated into lon/lat by the overview map
|
||||
* @type OpenLayers.LonLat
|
||||
*/
|
||||
* Method: getLonLatFromOverviewPx
|
||||
* Get a map location from a pixel location
|
||||
*
|
||||
* Parameters:
|
||||
* overviewMapPx - {<OpenLayers.Pixel>}
|
||||
*
|
||||
* Return:
|
||||
* {<OpenLayers.LonLat>} Location which is the passed-in overview map
|
||||
* OpenLayers.Pixel, translated into lon/lat by the overview map
|
||||
*/
|
||||
getLonLatFromOverviewPx: function(overviewMapPx) {
|
||||
var size = this.ovmap.size;
|
||||
var res = this.ovmap.getResolution();
|
||||
@@ -585,12 +661,16 @@ OpenLayers.Control.OverviewMap.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.LonLat} lonlat
|
||||
*
|
||||
* @returns An OpenLayers.Pixel which is the passed-in OpenLayers.LonLat,
|
||||
* translated into overview map pixels
|
||||
* @type OpenLayers.Pixel
|
||||
*/
|
||||
* Method: getOverviewPxFromLonLat
|
||||
* Get a pixel location from a map location
|
||||
*
|
||||
* Parameters:
|
||||
* lonlat - {<OpenLayers.LonLat>}
|
||||
*
|
||||
* Return:
|
||||
* {<OpenLayers.Pixel>} Location which is the passed-in OpenLayers.LonLat,
|
||||
* translated into overview map pixels
|
||||
*/
|
||||
getOverviewPxFromLonLat: function(lonlat) {
|
||||
var res = this.ovmap.getResolution();
|
||||
var extent = this.ovmap.getExtent();
|
||||
@@ -603,7 +683,10 @@ OpenLayers.Control.OverviewMap.prototype =
|
||||
return px;
|
||||
},
|
||||
|
||||
/** @final @type String */
|
||||
/**
|
||||
* Constant: CLASS_NAME
|
||||
* {String} Name of this class
|
||||
*/
|
||||
CLASS_NAME: 'OpenLayers.Control.OverviewMap'
|
||||
|
||||
});
|
||||
|
||||
@@ -4,9 +4,12 @@
|
||||
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/Control.js
|
||||
*
|
||||
* Class: OpenLayers.PanZoom
|
||||
*
|
||||
* Inherits from:
|
||||
* - <OpenLayers.Control>
|
||||
*/
|
||||
OpenLayers.Control.PanZoom = OpenLayers.Class.create();
|
||||
OpenLayers.Control.PanZoom.X = 4;
|
||||
@@ -14,17 +17,26 @@ OpenLayers.Control.PanZoom.Y = 4;
|
||||
OpenLayers.Control.PanZoom.prototype =
|
||||
OpenLayers.Class.inherit( OpenLayers.Control, {
|
||||
|
||||
/** @type int */
|
||||
/**
|
||||
* APIProperty: slideFactor
|
||||
* {Float}
|
||||
*/
|
||||
slideFactor: 50,
|
||||
|
||||
/** @type Array of Button Divs */
|
||||
/**
|
||||
* Property: buttons
|
||||
* Array of Button Divs
|
||||
*/
|
||||
buttons: null,
|
||||
|
||||
/** @type OpenLayers.Pixel */
|
||||
/**
|
||||
* Property: position
|
||||
* {<OpenLayers.Pixel>}
|
||||
*/
|
||||
position: null,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* Constructor: OpenLayers.PanZoom
|
||||
*/
|
||||
initialize: function() {
|
||||
this.position = new OpenLayers.Pixel(OpenLayers.Control.PanZoom.X,
|
||||
@@ -33,7 +45,7 @@ OpenLayers.Control.PanZoom.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
* APIMethod: destroy
|
||||
*/
|
||||
destroy: function() {
|
||||
OpenLayers.Control.prototype.destroy.apply(this, arguments);
|
||||
@@ -47,10 +59,13 @@ OpenLayers.Control.PanZoom.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Pixel} px
|
||||
* Method: draw
|
||||
*
|
||||
* Parameters:
|
||||
* px - {<OpenLayers.Pixel>}
|
||||
*
|
||||
* @returns A reference to the container div for the PanZoom control
|
||||
* @type DOMElement
|
||||
* Returns:
|
||||
* {DOMElement} A reference to the container div for the PanZoom control
|
||||
*/
|
||||
draw: function(px) {
|
||||
// initialize our internal div
|
||||
@@ -79,15 +94,17 @@ OpenLayers.Control.PanZoom.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {String} id
|
||||
* @param {String} img
|
||||
* @param {OpenLayers.Pixel} xy
|
||||
* @param {OpenLayers.Size} sz
|
||||
* Method: _addButton
|
||||
*
|
||||
* @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
|
||||
* Parameters:
|
||||
* id - {String}
|
||||
* img - {String}
|
||||
* xy - {<OpenLayers.Pixel>}
|
||||
* sz - {<OpenLayers.Size>}
|
||||
*
|
||||
* Returns:
|
||||
* {DOMElement} A Div (an alphaImageDiv, to be precise) that contains the
|
||||
* image of the button, and has all the proper event handlers set.
|
||||
*/
|
||||
_addButton:function(id, img, xy, sz) {
|
||||
var imgLocation = OpenLayers.Util.getImagesLocation() + img;
|
||||
@@ -116,9 +133,12 @@ OpenLayers.Control.PanZoom.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {Event} evt
|
||||
*
|
||||
* @type Boolean
|
||||
* Method: doubleClick
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {Event}
|
||||
*
|
||||
* Returns: {Boolean}
|
||||
*/
|
||||
doubleClick: function (evt) {
|
||||
OpenLayers.Event.stop(evt);
|
||||
@@ -126,7 +146,10 @@ OpenLayers.Control.PanZoom.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {Event} evt
|
||||
* Method: buttonDown
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {Event}
|
||||
*/
|
||||
buttonDown: function (evt) {
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
|
||||
@@ -4,38 +4,60 @@
|
||||
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/Control/PanZoom.js
|
||||
*
|
||||
* Class: OpenLayers.Control.PanZoomBar
|
||||
*
|
||||
* Inherits from:
|
||||
* - <OpenLayers.Control.PanZoom>
|
||||
* - <OpenLayers.Control>
|
||||
*/
|
||||
OpenLayers.Control.PanZoomBar = OpenLayers.Class.create();
|
||||
OpenLayers.Control.PanZoomBar.prototype =
|
||||
OpenLayers.Class.inherit( OpenLayers.Control.PanZoom, {
|
||||
|
||||
/** @type int */
|
||||
/**
|
||||
* APIProperty: zoomStopWidth
|
||||
*/
|
||||
zoomStopWidth: 18,
|
||||
|
||||
/** @type int */
|
||||
/**
|
||||
* APIProperty: zoomStopHeight
|
||||
*/
|
||||
zoomStopHeight: 11,
|
||||
|
||||
/** @type DOMElement */
|
||||
/**
|
||||
* Property: slider
|
||||
*/
|
||||
slider: null,
|
||||
|
||||
/** @type OpenLayers.Events */
|
||||
/**
|
||||
* Property: sliderEvents
|
||||
* {<OpenLayers.Events>}
|
||||
*/
|
||||
sliderEvents: null,
|
||||
|
||||
/** @type DOMElement */
|
||||
/**
|
||||
* Property: zoomBarDiv
|
||||
* {DOMElement}
|
||||
*/
|
||||
zoomBarDiv: null,
|
||||
|
||||
/** @type OpenLayers.Events */
|
||||
/**
|
||||
* Property: divEvents
|
||||
* {<OpenLayers.Events>}
|
||||
*/
|
||||
divEvents: null,
|
||||
|
||||
/**
|
||||
* Constructor: <OpenLayers.Control.PanZoomBar>
|
||||
*/
|
||||
initialize: function() {
|
||||
OpenLayers.Control.PanZoom.prototype.initialize.apply(this, arguments);
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
* APIMethod: destroy
|
||||
*/
|
||||
destroy: function() {
|
||||
|
||||
@@ -58,15 +80,19 @@ OpenLayers.Control.PanZoomBar.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Map} map
|
||||
* Method: setMap
|
||||
*
|
||||
* Parameters:
|
||||
* map - {<OpenLayers.Map>}
|
||||
*/
|
||||
setMap: function(map) {
|
||||
OpenLayers.Control.PanZoom.prototype.setMap.apply(this, arguments);
|
||||
this.map.events.register("changebaselayer", this, this.redraw);
|
||||
},
|
||||
|
||||
/** clear the div and start over.
|
||||
*
|
||||
/**
|
||||
* Method: redraw
|
||||
* clear the div and start over.
|
||||
*/
|
||||
redraw: function() {
|
||||
if (this.div != null) {
|
||||
@@ -76,7 +102,10 @@ OpenLayers.Control.PanZoomBar.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Pixel} px
|
||||
* Method: draw
|
||||
*
|
||||
* Parameters:
|
||||
* px - {<OpenLayers.Pixel>}
|
||||
*/
|
||||
draw: function(px) {
|
||||
// initialize our internal div
|
||||
@@ -101,7 +130,10 @@ OpenLayers.Control.PanZoomBar.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Pixel} location where zoombar drawing is to start.
|
||||
* Method: _addZoomBar
|
||||
*
|
||||
* Parameters:
|
||||
* location - {<OpenLayers.Pixel>} where zoombar drawing is to start.
|
||||
*/
|
||||
_addZoomBar:function(centered) {
|
||||
var imgLocation = OpenLayers.Util.getImagesLocation();
|
||||
@@ -162,17 +194,22 @@ OpenLayers.Control.PanZoomBar.prototype =
|
||||
this.zoomStopHeight * this.map.getNumZoomLevels());
|
||||
return centered;
|
||||
},
|
||||
/*
|
||||
|
||||
/*
|
||||
* Method: passEventToSlider
|
||||
* This function is used to pass events that happen on the div, or the map,
|
||||
* through to the slider, which then does its moving thing.
|
||||
* @param {OpenLayers.Event} evt
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {<OpenLayers.Event>}
|
||||
*/
|
||||
passEventToSlider:function(evt) {
|
||||
this.sliderEvents.handleBrowserEvent(evt);
|
||||
},
|
||||
|
||||
/*
|
||||
* divClick: Picks up on clicks directly on the zoombar div
|
||||
* Method: divClick
|
||||
* Picks up on clicks directly on the zoombar div
|
||||
* and sets the zoom level appropriately.
|
||||
*/
|
||||
divClick: function (evt) {
|
||||
@@ -184,9 +221,12 @@ OpenLayers.Control.PanZoomBar.prototype =
|
||||
OpenLayers.Event.stop(evt);
|
||||
},
|
||||
|
||||
/*
|
||||
/*
|
||||
* Method: zoomBarDown
|
||||
* event listener for clicks on the slider
|
||||
* @param {OpenLayers.Event} evt
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {<OpenLayers.Event>}
|
||||
*/
|
||||
zoomBarDown:function(evt) {
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
@@ -201,10 +241,14 @@ OpenLayers.Control.PanZoomBar.prototype =
|
||||
},
|
||||
|
||||
/*
|
||||
* This is what happens when a click has occurred, and the client is dragging.
|
||||
* Here we must ensure that the slider doesn't go beyond the bottom/top of the
|
||||
* zoombar div, as well as moving the slider to its new visual location
|
||||
* @param {OpenLayers.Event} evt
|
||||
* Method: zoomBarDrag
|
||||
* This is what happens when a click has occurred, and the client is
|
||||
* dragging. Here we must ensure that the slider doesn't go beyond the
|
||||
* bottom/top of the zoombar div, as well as moving the slider to its new
|
||||
* visual location
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {<OpenLayers.Event>}
|
||||
*/
|
||||
zoomBarDrag:function(evt) {
|
||||
if (this.mouseDragStart != null) {
|
||||
@@ -220,10 +264,13 @@ OpenLayers.Control.PanZoomBar.prototype =
|
||||
}
|
||||
},
|
||||
|
||||
/*
|
||||
/*
|
||||
* Method: zoomBarUp
|
||||
* Perform cleanup when a mouseup event is received -- discover new zoom
|
||||
* level and switch to it.
|
||||
* @param {OpenLayers.Event} evt
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {<OpenLayers.Event>}
|
||||
*/
|
||||
zoomBarUp:function(evt) {
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
@@ -239,7 +286,8 @@ OpenLayers.Control.PanZoomBar.prototype =
|
||||
}
|
||||
},
|
||||
|
||||
/*
|
||||
/*
|
||||
* Method: moveZoomBar
|
||||
* Change the location of the slider to match the current zoom level.
|
||||
*/
|
||||
moveZoomBar:function() {
|
||||
|
||||
@@ -3,36 +3,44 @@
|
||||
* for the full text of the license. */
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/Control.js
|
||||
*
|
||||
* Class: OpenLayers.Control.Panel
|
||||
*
|
||||
* Inherits from:
|
||||
* - <OpenLayers.Control>
|
||||
*/
|
||||
OpenLayers.Control.Panel = OpenLayers.Class.create();
|
||||
OpenLayers.Control.Panel.prototype =
|
||||
OpenLayers.Class.inherit( OpenLayers.Control, {
|
||||
/**
|
||||
* @type Array(OpenLayers.Control)
|
||||
* Property: controls
|
||||
* Array({<OpenLayers.Control>})
|
||||
*/
|
||||
controls: null,
|
||||
|
||||
/**
|
||||
* The control which is activated when the control is activated (turned
|
||||
* on), which also happens at instantiation.
|
||||
* @type OpenLayers.Control
|
||||
* APIProperty: defaultControl
|
||||
* <OpenLayers.Control> The control which is activated when the control is
|
||||
* activated (turned on), which also happens at instantiation.
|
||||
*/
|
||||
defaultControl: null,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* Constructor: OpenLayers.Control
|
||||
*
|
||||
* @param {DOMElement} element
|
||||
* @param {String} base
|
||||
* Parameters:
|
||||
* element - {DOMElement}
|
||||
* base - {String}
|
||||
*/
|
||||
initialize: function(element) {
|
||||
OpenLayers.Control.prototype.initialize.apply(this, arguments);
|
||||
this.controls = [];
|
||||
},
|
||||
|
||||
/**
|
||||
* APIMethod: destroy
|
||||
*/
|
||||
destroy: function() {
|
||||
OpenLayers.Control.prototype.destroy.apply(this, arguments);
|
||||
for(var i = this.controls.length - 1 ; i >= 0; i--) {
|
||||
@@ -41,6 +49,9 @@ OpenLayers.Control.Panel.prototype =
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* APIMethod: activate
|
||||
*/
|
||||
activate: function() {
|
||||
if (OpenLayers.Control.prototype.activate.apply(this, arguments)) {
|
||||
for(var i = 0; i < this.controls.length; i++) {
|
||||
@@ -55,6 +66,9 @@ OpenLayers.Control.Panel.prototype =
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* APIMethod: deactivate
|
||||
*/
|
||||
deactivate: function() {
|
||||
if (OpenLayers.Control.prototype.deactivate.apply(this, arguments)) {
|
||||
for(var i = 0; i < this.controls.length; i++) {
|
||||
@@ -68,7 +82,9 @@ OpenLayers.Control.Panel.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @type DOMElement
|
||||
* Method: draw
|
||||
*
|
||||
* Returns: {DOMElement}
|
||||
*/
|
||||
draw: function() {
|
||||
OpenLayers.Control.prototype.draw.apply(this, arguments);
|
||||
@@ -81,7 +97,7 @@ OpenLayers.Control.Panel.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @private
|
||||
* Method: redraw
|
||||
*/
|
||||
redraw: function() {
|
||||
this.div.innerHTML = "";
|
||||
@@ -98,6 +114,12 @@ OpenLayers.Control.Panel.prototype =
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* APIMethod: activateControl
|
||||
*
|
||||
* Parameters:
|
||||
* control - {<OpenLayers.Control>}
|
||||
*/
|
||||
activateControl: function (control) {
|
||||
if (!this.active) { return false; }
|
||||
if (control.type == OpenLayers.Control.TYPE_BUTTON) {
|
||||
@@ -125,10 +147,13 @@ OpenLayers.Control.Panel.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* APIMethod: addControls
|
||||
* To build a toolbar, you add a set of controls to it. addControls
|
||||
* lets you add a single control or a list of controls to the
|
||||
* Control Panel.
|
||||
* @param {OpenLayers.Control} controls
|
||||
*
|
||||
* Parameters:
|
||||
* controls - {<OpenLayers.Control>}
|
||||
*/
|
||||
addControls: function(controls) {
|
||||
if (!(controls instanceof Array)) {
|
||||
@@ -159,7 +184,10 @@ OpenLayers.Control.Panel.prototype =
|
||||
this.redraw();
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Method: onClick
|
||||
*/
|
||||
onClick: function (ctrl, evt) {
|
||||
OpenLayers.Event.stop(evt ? evt : window.event);
|
||||
this.activateControl(ctrl);
|
||||
|
||||
@@ -4,25 +4,35 @@
|
||||
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/Control.js
|
||||
*
|
||||
* Class: OpenLayers.Control.Permalink
|
||||
*
|
||||
* Inherits from:
|
||||
* - <OpenLayers.Control>
|
||||
*/
|
||||
OpenLayers.Control.Permalink = OpenLayers.Class.create();
|
||||
OpenLayers.Control.Permalink.prototype =
|
||||
OpenLayers.Class.inherit( OpenLayers.Control, {
|
||||
|
||||
/** @type DOMElement */
|
||||
/**
|
||||
* Property: element
|
||||
* {DOMElement}
|
||||
*/
|
||||
element: null,
|
||||
|
||||
/** @type String */
|
||||
/**
|
||||
* APIProperty: base
|
||||
* {String}
|
||||
*/
|
||||
base: '',
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*
|
||||
* @param {DOMElement} element
|
||||
* @param {String} base
|
||||
* Constructor: OpenLayers.Control.Permalink
|
||||
*
|
||||
* Parameters:
|
||||
* element - {DOMElement}
|
||||
* base - {String}
|
||||
*/
|
||||
initialize: function(element, base) {
|
||||
OpenLayers.Control.prototype.initialize.apply(this, arguments);
|
||||
@@ -33,7 +43,7 @@ OpenLayers.Control.Permalink.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
* APIMethod: destroy
|
||||
*/
|
||||
destroy: function() {
|
||||
if (this.element.parentNode == this.div) {
|
||||
@@ -46,9 +56,12 @@ OpenLayers.Control.Permalink.prototype =
|
||||
OpenLayers.Control.prototype.destroy.apply(this, arguments);
|
||||
},
|
||||
|
||||
/** Set the map property for the control.
|
||||
/**
|
||||
* Method: setMap
|
||||
* Set the map property for the control.
|
||||
*
|
||||
* @param {OpenLayers.Map} map
|
||||
* Parameters:
|
||||
* map - {<OpenLayers.Map>}
|
||||
*/
|
||||
setMap: function(map) {
|
||||
OpenLayers.Control.prototype.setMap.apply(this, arguments);
|
||||
@@ -67,7 +80,9 @@ OpenLayers.Control.Permalink.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @type DOMElement
|
||||
* Method: draw
|
||||
*
|
||||
* Returns: {DOMElement}
|
||||
*/
|
||||
draw: function() {
|
||||
OpenLayers.Control.prototype.draw.apply(this, arguments);
|
||||
@@ -85,7 +100,7 @@ OpenLayers.Control.Permalink.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
* Method: updateLink
|
||||
*/
|
||||
updateLink: function() {
|
||||
var center = this.map.getCenter();
|
||||
|
||||
@@ -4,21 +4,29 @@
|
||||
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/Control.js
|
||||
*
|
||||
* Class: OpenLayers.Control.Scale
|
||||
* Display a small scale indicator on the map.
|
||||
* Inherits from:
|
||||
* - <OpenLayers.Control>
|
||||
*/
|
||||
OpenLayers.Control.Scale = OpenLayers.Class.create();
|
||||
OpenLayers.Control.Scale.prototype =
|
||||
OpenLayers.Class.inherit( OpenLayers.Control, {
|
||||
/** @type DOMElement */
|
||||
|
||||
/**
|
||||
* Parameter: element
|
||||
* {DOMElement}
|
||||
*/
|
||||
element: null,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* Constructor: OpenLayers.Control.Scale
|
||||
*
|
||||
* @param {DOMElement} element
|
||||
* @param {String} base
|
||||
* Parameters:
|
||||
* element - {DOMElement}
|
||||
* base - {String}
|
||||
*/
|
||||
initialize: function(element) {
|
||||
OpenLayers.Control.prototype.initialize.apply(this, arguments);
|
||||
@@ -26,7 +34,9 @@ OpenLayers.Control.Scale.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @type DOMElement
|
||||
* Method: draw
|
||||
*
|
||||
* Returns: {DOMElemen}t
|
||||
*/
|
||||
draw: function() {
|
||||
OpenLayers.Control.prototype.draw.apply(this, arguments);
|
||||
@@ -42,7 +52,7 @@ OpenLayers.Control.Scale.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
* Method: updateScale
|
||||
*/
|
||||
updateScale: function() {
|
||||
var scale = this.map.getScale();
|
||||
|
||||
@@ -4,64 +4,77 @@
|
||||
|
||||
|
||||
/**
|
||||
* Draws features on a vector layer when active.
|
||||
*
|
||||
* @class
|
||||
* @requires OpenLayers/Control.js
|
||||
* @requires OpenLayers/Feature/Vector.js
|
||||
*
|
||||
* Class: OpenLayers.Control.SelectFeature
|
||||
* Draws features on a vector layer when active.
|
||||
*
|
||||
* Inherits from:
|
||||
* - <OpenLayers.Control>
|
||||
*/
|
||||
OpenLayers.Control.SelectFeature = OpenLayers.Class.create();
|
||||
OpenLayers.Control.SelectFeature.prototype =
|
||||
OpenLayers.Class.inherit(OpenLayers.Control, {
|
||||
|
||||
/**
|
||||
* @type {Boolean} Allow selection of multiple geometries
|
||||
* APIProperty: multiple
|
||||
* {Boolean} Allow selection of multiple geometries
|
||||
*/
|
||||
multiple: false,
|
||||
|
||||
/**
|
||||
* @type {Boolean} Select on mouse over and deselect on mouse out. If
|
||||
* true, this ignores clicks and only listens to mouse moves.
|
||||
* APIProperty: hover
|
||||
* {Boolean} Select on mouse over and deselect on mouse out. If true, this
|
||||
* ignores clicks and only listens to mouse moves.
|
||||
*/
|
||||
hover: false,
|
||||
|
||||
/**
|
||||
* @type {Function} Optional function to be called when a feature is selected.
|
||||
* The function should expect to be called with a feature.
|
||||
* APIProperty: onSelect
|
||||
* {Function} Optional function to be called when a feature is selected.
|
||||
* The function should expect to be called with a feature.
|
||||
*/
|
||||
onSelect: function() {},
|
||||
|
||||
/**
|
||||
* @type {Function} Optional function to be called when a feature is unselected.
|
||||
* APIProperty: onUnselect
|
||||
* {Function} Optional function to be called when a feature is unselected.
|
||||
* The function should expect to be called with a feature.
|
||||
*/
|
||||
onUnselect: function() {},
|
||||
|
||||
/**
|
||||
* @type {OpenLayers.Layer.Vector}
|
||||
* Property: layer
|
||||
* {<OpenLayers.Layer.Vector>}
|
||||
*/
|
||||
layer: null,
|
||||
|
||||
/**
|
||||
* @type {Object} The functions that are sent to the handler for callback
|
||||
* APIProperty: callbacks
|
||||
* {Object} The functions that are sent to the handler for callback
|
||||
*/
|
||||
callbacks: null,
|
||||
|
||||
/**
|
||||
* @type {Object} Hash of styles
|
||||
* APIProperty: selectStyle
|
||||
* {Object} Hash of styles
|
||||
*/
|
||||
selectStyle: OpenLayers.Feature.Vector.style['select'],
|
||||
|
||||
/**
|
||||
* @type {OpenLayers.Handler.Feature}
|
||||
* @private
|
||||
* Property: handler
|
||||
* {<OpenLayers.Handler.Feature>}
|
||||
*/
|
||||
handler: null,
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Layer.Vector} layer
|
||||
* @param {OpenLayers.Handler} handler
|
||||
* @param {Object} options
|
||||
* Constructor: <OpenLayers.Control.SelectFeature>
|
||||
*
|
||||
* Parameters:
|
||||
* layer - {<OpenLayers.Layer.Vector>}
|
||||
* handler - {<OpenLayers.Handler>}
|
||||
* options - {Object}
|
||||
*/
|
||||
initialize: function(layer, options) {
|
||||
OpenLayers.Control.prototype.initialize.apply(this, [options]);
|
||||
@@ -75,8 +88,11 @@ OpenLayers.Control.SelectFeature.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: downFeature
|
||||
* Called when the feature handler detects a mouse-down on a feature
|
||||
* @param {OpenLayers.Vector.Feature}
|
||||
*
|
||||
* Parameters:
|
||||
* feature - {<OpenLayers.Vector.Feature>}
|
||||
*/
|
||||
downFeature: function(feature) {
|
||||
if(this.hover) {
|
||||
@@ -103,9 +119,12 @@ OpenLayers.Control.SelectFeature.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: overFeature
|
||||
* Called when the feature handler detects a mouse-over on a feature.
|
||||
* Only responds if this.hover is true.
|
||||
* @param {OpenLayers.Feature.Vector}
|
||||
*
|
||||
* Parameters:
|
||||
* feature - {<OpenLayers.Feature.Vector>}
|
||||
*/
|
||||
overFeature: function(feature) {
|
||||
if(!this.hover) {
|
||||
@@ -117,9 +136,12 @@ OpenLayers.Control.SelectFeature.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: outFeature
|
||||
* Called when the feature handler detects a mouse-out on a feature.
|
||||
* Only responds if this.hover is true.
|
||||
* @param {OpenLayers.Feature.Vector}
|
||||
*
|
||||
* Parameters:
|
||||
* feature - {<OpenLayers.Feature.Vector>}
|
||||
*/
|
||||
outFeature: function(feature) {
|
||||
if(!this.hover) {
|
||||
@@ -129,9 +151,12 @@ OpenLayers.Control.SelectFeature.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: select
|
||||
* Add feature to the layer's selectedFeature array, render the feature as
|
||||
* selected, and call the onSelect function.
|
||||
* @param {OpenLayers.Feature.Vector} feature
|
||||
*
|
||||
* Parameters:
|
||||
* feature - {<OpenLayers.Feature.Vector>}
|
||||
*/
|
||||
select: function(feature) {
|
||||
// Store feature style for restoration later
|
||||
@@ -144,9 +169,12 @@ OpenLayers.Control.SelectFeature.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: unselect
|
||||
* Remove feature from the layer's selectedFeature array, render the feature as
|
||||
* normal, and call the onUnselect function.
|
||||
* @param {OpenLayers.Feature.Vector} feature
|
||||
*
|
||||
* Parameters:
|
||||
* feature - {<OpenLayers.Feature.Vector>}
|
||||
*/
|
||||
unselect: function(feature) {
|
||||
// Store feature style for restoration later
|
||||
@@ -158,9 +186,12 @@ OpenLayers.Control.SelectFeature.prototype =
|
||||
this.onUnselect(feature);
|
||||
},
|
||||
|
||||
/** Set the map property for the control.
|
||||
/**
|
||||
* Method: setMap
|
||||
* Set the map property for the control.
|
||||
*
|
||||
* @param {OpenLayers.Map} map
|
||||
* Parameters:
|
||||
* map - {<OpenLayers.Map>}
|
||||
*/
|
||||
setMap: function(map) {
|
||||
this.handler.setMap(map);
|
||||
|
||||
@@ -3,25 +3,37 @@
|
||||
* for the full text of the license. */
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/Control.js
|
||||
* @requires OpenLayers/Handler/Box.js
|
||||
*
|
||||
* Class: OpenLayers.Control.ZoomBox
|
||||
*
|
||||
* Inherits from:
|
||||
* - <OpenLayers.Control>
|
||||
*/
|
||||
OpenLayers.Control.ZoomBox = OpenLayers.Class.create();
|
||||
OpenLayers.Control.ZoomBox.prototype =
|
||||
OpenLayers.Class.inherit( OpenLayers.Control, {
|
||||
/** @type OpenLayers.Control.TYPE_* */
|
||||
/**
|
||||
* Property: type
|
||||
* {OpenLayers.Control.TYPE}
|
||||
*/
|
||||
type: OpenLayers.Control.TYPE_TOOL,
|
||||
|
||||
/**
|
||||
*
|
||||
* Method: draw
|
||||
*/
|
||||
draw: function() {
|
||||
this.handler = new OpenLayers.Handler.Box( this,
|
||||
{done: this.zoomBox}, {keyMask: this.keyMask} );
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: zoomBox
|
||||
*
|
||||
* Parameters:
|
||||
* position - {<OpenLayers.Bounds>} or {<OpenLayers.Pixel>}
|
||||
*/
|
||||
zoomBox: function (position) {
|
||||
if (position instanceof OpenLayers.Bounds) {
|
||||
var minXY = this.map.getLonLatFromPixel(
|
||||
|
||||
@@ -3,17 +3,28 @@
|
||||
* for the full text of the license. */
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* Imlements a very simple button control.
|
||||
* @requires OpenLayers/Control.js
|
||||
*
|
||||
* Class: OpenLayers.Control.ZoomToMaxExtent
|
||||
* Imlements a very simple button control. Designed to be used with a
|
||||
* <OpenLayers.Control.Panel>.
|
||||
*
|
||||
* Inherits from:
|
||||
* - <OpenLayers.Control>
|
||||
*/
|
||||
OpenLayers.Control.ZoomToMaxExtent = OpenLayers.Class.create();
|
||||
OpenLayers.Control.ZoomToMaxExtent.prototype =
|
||||
OpenLayers.Class.inherit( OpenLayers.Control, {
|
||||
/** @type OpenLayers.Control.TYPE_* */
|
||||
/**
|
||||
* Property: type
|
||||
* TYPE_BUTTON.
|
||||
*/
|
||||
type: OpenLayers.Control.TYPE_BUTTON,
|
||||
|
||||
/*
|
||||
* Method: trigger
|
||||
* Do the zoom.
|
||||
*/
|
||||
trigger: function() {
|
||||
if (this.map) {
|
||||
this.map.zoomToMaxExtent();
|
||||
|
||||
Reference in New Issue
Block a user