Support changing the modification key used to draw the zoomBox, from Jachym

with minor modifications. (Closes #1769)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@8285 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2008-11-05 21:53:34 +00:00
parent b916be5489
commit d9adcf5a4e

View File

@@ -54,6 +54,17 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, {
*/ */
handleRightClicks: false, handleRightClicks: false,
/**
* APIProperty: zoomBoxKeyMask
* {Integer} <OpenLayers.Handler> key code of the key, which has to be
* pressed, while drawing the zoom box with the mouse on the screen.
* You should probably set handleRightClicks to true if you use this
* with MOD_CTRL, to disable the context menu for machines which use
* CTRL-Click as a right click.
* Default: <OpenLayers.Handler.MOD_SHIFT
*/
zoomBoxKeyMask: OpenLayers.Handler.MOD_SHIFT,
/** /**
* Constructor: OpenLayers.Control.Navigation * Constructor: OpenLayers.Control.Navigation
* Create a new navigation control * Create a new navigation control
@@ -136,7 +147,7 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, {
OpenLayers.Util.extend({map: this.map}, this.dragPanOptions) OpenLayers.Util.extend({map: this.map}, this.dragPanOptions)
); );
this.zoomBox = new OpenLayers.Control.ZoomBox( this.zoomBox = new OpenLayers.Control.ZoomBox(
{map: this.map, keyMask: OpenLayers.Handler.MOD_SHIFT}); {map: this.map, keyMask: this.zoomBoxKeyMask});
this.dragPan.draw(); this.dragPan.draw();
this.zoomBox.draw(); this.zoomBox.draw();
this.handlers.wheel = new OpenLayers.Handler.MouseWheel( this.handlers.wheel = new OpenLayers.Handler.MouseWheel(