OpenLayers. Handler. Point

Handler to draw a point on the map.  Point is displayed on activation, moves on mouse move, and is finished on mouse up.  The handler triggers callbacks for ‘done’, ‘cancel’, and ‘modify’.  The modify callback is called with each change in the sketch and will receive the latest point drawn.  Create a new instance with the OpenLayers.Handler.Point constructor.

Inherits from

Summary
OpenLayers. Handler. Point Handler to draw a point on the map.
Properties
multi {Boolean} Cast features to multi-part geometries before passing to the layer.
citeCompliant {Boolean} If set to true, coordinates of features drawn in a map extent crossing the date line won’t exceed the world bounds.
persist {Boolean} Leave the feature rendered until destroyFeature is called.
stopDown {Boolean} Stop event propagation on mousedown.
pixelTolerance {Number} Maximum number of pixels between down and up (mousedown and mouseup, or touchstart and touchend) for the handler to add a new point.
Constructor
OpenLayers. Handler. Point Create a new point handler.
Functions
activate turn on the handler
deactivate turn off the handler
cancel Finish the geometry and call the “cancel” callback.

Properties

multi

{Boolean} Cast features to multi-part geometries before passing to the layer.  Default is false.

citeCompliant

{Boolean} If set to true, coordinates of features drawn in a map extent crossing the date line won’t exceed the world bounds.  Default is false.

persist

{Boolean} Leave the feature rendered until destroyFeature is called.  Default is false.  If set to true, the feature remains rendered until destroyFeature is called, typically by deactivating the handler or starting another drawing.

stopDown

{Boolean} Stop event propagation on mousedown.  Must be false to allow “pan while drawing”.  Defaults to false.

pixelTolerance

{Number} Maximum number of pixels between down and up (mousedown and mouseup, or touchstart and touchend) for the handler to add a new point.  If set to an integer value, if the displacement between down and up is great to this value no point will be added.  Default value is 5.

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 properties whose values are functions.  Various callbacks described below.
options {Object} An optional object with properties to be set on the handler

Named callbacks

create Called when a sketch is first created.  Callback called with the creation point geometry and sketch feature.
modify Called with each move of a vertex with the vertex (point) geometry and the sketch feature.
done Called when the point drawing is finished.  The callback will recieve a single argument, the point geometry.
cancel Called when the handler is deactivated while drawing.  The cancel callback will receive a geometry.

Functions

activate

activate: function()

turn on the handler

deactivate

deactivate: function()

turn off the handler

cancel

cancel: function()

Finish the geometry and call the “cancel” callback.

activate: function()
turn on the handler
deactivate: function()
turn off the handler
cancel: function()
Finish the geometry and call the “cancel” callback.
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.
Close