OpenLayers. Handler. Feature

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

Summary
Handler to respond to mouse events related to a drawn feature.
{Int}
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}

Functions

OpenLayers. Handler. Feature

Parameters

control{OpenLayers.Control}
layers{Array} List of OpenLayers.Layer.Vector
callbacks{Array} 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}

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

Return

{Boolean} A feature was selected

activate

activate: function()

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

Return: {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.
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.