Handler to respond to mouse events related to a drawn feature. Callbacks with the following keys will be notified of the following events associated with features: click, clickout, over, out, and dblclick.
This handler stops event propagation for mousedown and mouseup if those browser events target features that can be selected.
| OpenLayers. Handler. Feature | Handler to respond to mouse events related to a drawn feature. |
| Properties | |
| EVENTMAP | {Object} A object mapping the browser events to objects with callback keys for in and out. |
| feature | {OpenLayers.Feature.Vector} The last feature that was hovered. |
| lastFeature | {OpenLayers.Feature.Vector} The last feature that was handled. |
| down | {OpenLayers.Pixel} The location of the last mousedown. |
| up | {OpenLayers.Pixel} The location of the last mouseup. |
| clickoutTolerance | {Number} The number of pixels the mouse can move during a click that still constitutes a click out. |
| geometryTypes | To restrict dragging to a limited set of geometry types, send a list of strings corresponding to the geometry class names. |
| stopClick | {Boolean} If stopClick is set to true, handled clicks do not propagate to other click listeners. |
| stopDown | {Boolean} If stopDown is set to true, handled mousedowns do not propagate to other mousedown listeners. |
| stopUp | {Boolean} If stopUp is set to true, handled mouseups do not propagate to other mouseup listeners. |
| Constructor | |
| OpenLayers. Handler. Feature | |
| Functions | |
| mousedown | Handle mouse down. |
| mouseup | Handle mouse up. |
| click | Handle click. |
| mousemove | Handle mouse moves. |
| dblclick | Handle dblclick. |
| geometryTypeMatches | Return true if the geometry type of the passed feature matches one of the geometry types in the geometryTypes array. |
| handle | |
| triggerCallback | Call the callback keyed in the event map with the supplied arguments. |
| activate | Turn on the handler. |
| deactivate | Turn off the handler. |
| moveLayerToTop | Moves the layer for this handler to the top, so mouse events can reach it. |
| moveLayerBack | Moves the layer back to the position determined by the map’s layers array. |
{OpenLayers.Feature.Vector} The last feature that was hovered.
{OpenLayers.Feature.Vector} The last feature that was handled.
{OpenLayers.Pixel} The location of the last mousedown.
{OpenLayers.Pixel} The location of the last mouseup.
| control | {OpenLayers.Control} |
| layers | {Array(OpenLayers.Layer.Vector)} |
| callbacks | {Object} An object with a ‘over’ property whos value is a function to be called when the mouse is over a feature. The callback should expect to recieve a single argument, the feature. |
| options | {Object} |
triggerCallback: function( type, mode, args )
Call the callback keyed in the event map with the supplied arguments. For click out, the clickoutTolerance is checked first.
| type | {String} |
Handle mouse down.
mousedown: function( evt )
Handle mouse up.
mouseup: function( evt )
Handle click.
click: function( evt )
Handle mouse moves.
mousemove: function( evt )
Handle dblclick.
dblclick: function( evt )
Return true if the geometry type of the passed feature matches one of the geometry types in the geometryTypes array.
geometryTypeMatches: function( feature )
handle: function( evt )
Call the callback keyed in the event map with the supplied arguments.
triggerCallback: function( type, mode, args )
Turn on the handler.
activate: function()
Turn off the handler.
deactivate: function()
Moves the layer for this handler to the top, so mouse events can reach it.
moveLayerToTop: function()
Moves the layer back to the position determined by the map’s layers array.
moveLayerBack: function()