OpenLayers.Handler.Box

Handler for dragging a rectangle across the map.  Box is displayed on mouse down, moves on mouse move, and is finished on mouse up.

Inherits from

Summary
OpenLayers.Handler.BoxHandler for dragging a rectangle across the map.
Properties
dragHandler{OpenLayers.Handler.Drag}
boxDivClassName{String} The CSS class to use for drawing the box.
boxCharacteristics{Object} Caches some box characteristics from css.
Constructor
OpenLayers.Handler.Box
Functions
setMap
startBox
moveBox
endBox
removeBoxRemove the zoombox from the screen and nullify our reference to it.
activate
deactivate
getCharacteristicsDetermines offset and box model for a box.

Properties

boxDivClassName

{String} The CSS class to use for drawing the box.  Default is olHandlerBoxZoomBox

boxCharacteristics

{Object} Caches some box characteristics from css.  This is used by the getBoxCharacteristics method.

Constructor

OpenLayers.Handler.Box

Parameters

control{OpenLayers.Control}
callbacks{Object} An object containing a single function to be called when the drag operation is finished.  The callback should expect to recieve a single argument, the point geometry.
options{Object}

Functions

setMap

setMap: function (map)

startBox

startBox: function (xy)

Parameters

evt{Event}

moveBox

moveBox: function (xy)

endBox

endBox: function(end)

removeBox

removeBox: function()

Remove the zoombox from the screen and nullify our reference to it.

activate

activate: function ()

deactivate

deactivate: function ()

getCharacteristics

Determines offset and box model for a box.

Returns

{Object} a hash with the following properties:

  • xOffset - Corner offset in x-direction
  • yOffset - Corner offset in y-direction
  • newBoxModel - true for all browsers except IE in quirks mode
The drag handler is used to deal with sequences of browser events related to dragging.
setMap: function (map)
startBox: function (xy)
moveBox: function (xy)
endBox: function(end)
removeBox: function()
Remove the zoombox from the screen and nullify our reference to it.
activate: function ()
deactivate: function ()
Base class to construct a higher-level handler for event sequences.
Controls affect the display or behavior of the map.
Close