OpenLayers. Handler. Feature

Handler to respond to mouse events related to a drawn feature.  Callbacks will be called for over, move, out, up, down, and click (corresponding to the equivalent mouse events).

Summary
Handler to respond to mouse events related to a drawn feature.
{Int}
Handle click.
Handle mouse down.
Handle mouse moves.
Handle mouse up.
Capture double-clicks.
Trigger the appropriate callback if a feature is under the mouse.
Turn on the handler.
Turn of the handler.

Properties

layerIndex

{Int}

Constructor

OpenLayers. Handler. Feature

Parameters

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}

Functions

click

click: function(evt)

Handle click.  Call the “click” callback if down on a feature.

Parameters

evt{Event}

mousedown

mousedown: function(evt)

Handle mouse down.  Call the “down” callback if down on a feature.

Parameters

evt{Event}

mousemove

mousemove: function(evt)

Handle mouse moves.  Call the “move” callback if moving over a feature.  Call the “over” callback if moving over a feature for the first time.  Call the “out” callback if moving off of a feature.

Parameters

evt{Event}

mouseup

mouseup: function(evt)

Handle mouse up.  Call the “up” callback if up on a feature.

Parameters

evt{Event}

dblclick

dblclick: function(evt)

Capture double-clicks.  Let the event continue propagating if the double-click doesn’t hit a feature.  Otherwise call the dblclick callback.

Parameters

evt{Event}

select

select: function(type,
evt)

Trigger the appropriate callback if a feature is under the mouse.

Parameters

type{String} Callback key

Returns

{Boolean} A feature was selected

activate

activate: function()

Turn on the handler.  Returns false if the handler was already active.

Returns

{Boolean}

activate

deactivate: function()

Turn of the handler.  Returns false if the handler was already active.

Returns

{Boolean}

Vector features use the OpenLayers.Geometry classes as geometry description.
click: function(evt)
Handle click.
mousedown: function(evt)
Handle mouse down.
mousemove: function(evt)
Handle mouse moves.
mouseup: function(evt)
Handle mouse up.
dblclick: function(evt)
Capture double-clicks.
select: function(type,
evt)
Trigger the appropriate callback if a feature is under the mouse.
activate: function()
Turn on the handler.
Controls affect the display or behavior of the map.
Instances of OpenLayers.Layer.Vector are used to render vector data from a variety of sources.