OpenLayers. Handler. Point

Handler to draw a point on the map.  Point is displayed on mouse down, moves on mouse move, and is finished on mouse up.  The handler triggers callbacks for ‘done’ and ‘cancel’.  Create a new instance with the OpenLayers.Handler.Point constructor.

Inherits from

Summary
Handler to draw a point on the map.
{OpenLayers.Feature.Vector} The currently drawn point
{OpenLayers.Layer.Vector} The temporary drawing layer
{Boolean} A point is being drawn
{Boolean} The mouse is down
{OpenLayers.Pixel} Location of the last mouse down
Create a new point handler.
turn on the handler
Add temporary features
turn off the handler
Destroy the temporary geometries
Finish the geometry and call the “done” callback.
Finish the geometry and call the “cancel” callback.
Handle double clicks.
Render features on the temporary layer.
Return a clone of the relevant geometry.
Handle mouse down.
Handle mouse move.
Handle mouse up.

Properties

point

{OpenLayers.Feature.Vector} The currently drawn point

layer

{OpenLayers.Layer.Vector} The temporary drawing layer

drawing

{Boolean} A point is being drawn

mouseDown

{Boolean} The mouse is down

lastDown

{OpenLayers.Pixel} Location of the last mouse down

Constructor

OpenLayers. Handler. Point

Create a new point handler.

Parameters

control{OpenLayers.Control} The control that owns this handler
callbacks{Object} An object with a ‘done’ property whos value is a function to be called when the point drawing is finished.  The callback should expect to recieve a single argument, the point geometry.  If the callbacks object contains a ‘cancel’ property, this function will be called when the handler is deactivated while drawing.  The cancel should expect to receive a geometry.
options{Object} An optional object with properties to be set on the handler

Functions

activate

activate: function()

turn on the handler

createFeature

createFeature: function()

Add temporary features

deactivate

deactivate: function()

turn off the handler

destroyFeature

destroyFeature: function()

Destroy the temporary geometries

finalize

finalize: function()

Finish the geometry and call the “done” callback.

cancel

cancel: function()

Finish the geometry and call the “cancel” callback.

dblclick

dblclick: function(evt)

Handle double clicks.

Parameters

evt{Event} The browser event

Returns

{Boolean} Allow event propagation

drawFeature

drawFeature: function()

Render features on the temporary layer.

geometryClone

geometryClone: function()

Return a clone of the relevant geometry.

Returns

{OpenLayers.Geometry.Point}

mousedown

mousedown: function(evt)

Handle mouse down.  Adjust the geometry and redraw.  Return determines whether to propagate the event on the map.

Parameters

evt{Event} The browser event

Returns

{Boolean} Allow event propagation

mousemove

mousemove: function (evt)

Handle mouse move.  Adjust the geometry and redraw.  Return determines whether to propagate the event on the map.

Parameters

evt{Event} The browser event

Returns

{Boolean} Allow event propagation

mouseup

mouseup: function (evt)

Handle mouse up.  Send the latest point in the geometry to the control.  Return determines whether to propagate the event on the map.

Parameters

evt{Event} The browser event

Returns

{Boolean} Allow event propagation

Vector features use the OpenLayers.Geometry classes as geometry description.
Instances of OpenLayers.Layer.Vector are used to render vector data from a variety of sources.
This class represents a screen coordinate, in x and y coordinates
activate: function()
turn on the handler
createFeature: function()
Add temporary features
deactivate: function()
turn off the handler
destroyFeature: function()
Destroy the temporary geometries
finalize: function()
Finish the geometry and call the “done” callback.
cancel: function()
Finish the geometry and call the “cancel” callback.
dblclick: function(evt)
Handle double clicks.
drawFeature: function()
Render features on the temporary layer.
geometryClone: function()
Return a clone of the relevant geometry.
mousedown: function(evt)
Handle mouse down.
mousemove: function (evt)
Handle mouse move.
mouseup: function (evt)
Handle mouse up.
Create a new point handler.
Base class to construct a higher-level handler for event sequences.
Controls affect the display or behavior of the map.
Point geometry class.