Optional
options: Partial<PointOptions>Property: active {Boolean}
APIProperty: 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.
APIProperty: control {<OpenLayers.Control>}. The control that initialized this handler. The control is assumed to have a valid map property - that map is used in the handler's own setMap method.
Property: evt {Event} This property references the last event handled by the handler. Note that this property is not part of the stable API. Use of the evt property should be restricted to controls in the library or other applications that are willing to update with changes to the OpenLayers code.
Property: id {String}
APIProperty: keyMask
{Integer} Use bitwise operators and one or more of the OpenLayers.Handler
constants to construct a keyMask. The keyMask is used by
Example: (code) // handler only responds if the Shift key is down handler.keyMask = OpenLayers.Handler.MOD_SHIFT;
// handler only responds if Ctrl-Shift is down
handler.keyMask = OpenLayers.Handler.MOD_SHIFT |
OpenLayers.Handler.MOD_CTRL;
(end)
Property: lastDown {<OpenLayers.Pixel>} Location of the last mouse down
Property: lastTouchPx {<OpenLayers.Pixel>} The last pixel used to know the distance between two touches (for double touch).
Property: lastUp {<OpenLayers.Pixel>}
Property: layer {<OpenLayers.Layer.Vector>} The temporary drawing layer
Property: layerOptions {Object} Any optional properties to be set on the sketch layer.
Property: map {<OpenLayers.Map>}
Property: mouseDown {Boolean} The mouse is down
APIProperty: multi {Boolean} Cast features to multi-part geometries before passing to the layer. Default is false.
APIProperty: 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.
APIProperty: 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.
Property: point {<OpenLayers.Feature.Vector>} The currently drawn point
APIProperty: stopDown {Boolean} Stop event propagation on mousedown. Must be false to allow "pan while drawing". Defaults to false.
Property: stoppedDown {Boolean} Indicate whether the last mousedown stopped the event propagation.
APIPropery: stopUp {Boolean} Stop event propagation on mouse. Must be false to allow "pan while dragging". Defaults to fase.
Property: touch {Boolean} Indicates the support of touch events. When touch events are started touch will be true and all mouse related listeners will do nothing.
APIMethod: activate turn on the handler
Method: callback Trigger the control's named callback with the given arguments
Parameters: name - {String} The key for the callback that is one of the properties of the handler's callbacks object. args - {Array(*)} An array of arguments (any type) with which to call the callback (defined by the control).
APIMethod: cancel Finish the geometry and call the "cancel" callback.
Method: checkModifiers
Check the keyMask on the handler. If no
Returns: {Boolean} The keyMask matches the keys down on an event.
Method: click Handle clicks. Clicks are stopped from propagating to other listeners on map.events or other dom elements.
Parameters: evt - {Event} The browser event
Returns: {Boolean} Allow event propagation
Method: createFeature Add temporary features
Parameters: pixel - {<OpenLayers.Pixel>} A pixel location on the map.
Method: dblclick Handle double-clicks. Double-clicks are stopped from propagating to other listeners on map.events or other dom elements.
Parameters: evt - {Event} The browser event
Returns: {Boolean} Allow event propagation
APIMethod: deactivate turn off the handler
Method: destroy Deconstruct the handler.
Method: destroyFeature Destroy the temporary geometries
Parameters: force - {Boolean} Destroy even if persist is true.
Method: destroyPersistedFeature Destroy the persisted feature.
Method: down Handle mousedown and touchstart. 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
Method: drawFeature Render features on the temporary layer.
Method: finalize Finish the geometry and call the "done" callback.
Parameters: cancel - {Boolean} Call cancel instead of done callback. Default is false.
Method: geometryClone Return a clone of the relevant geometry.
Returns: {<OpenLayers.Geometry>}
Method: getGeometry
Return the sketch geometry. If
Returns: {<OpenLayers.Geometry.Polygon>}
Method: modifyFeature Modify the existing geometry given a pixel location.
Parameters: pixel - {<OpenLayers.Pixel>} A pixel location on the map.
Method: mousedown Handle mousedown.
Parameters: evt - {Event} The browser event
Returns: {Boolean} Allow event propagation
Method: mousemove Handle mousemove.
Parameters: evt - {Event} The browser event
Returns: {Boolean} Allow event propagation
Method: mouseout Handle mouse out. For better user experience reset mouseDown and stoppedDown when the mouse leaves the map viewport.
Parameters: evt - {Event} The browser event
Method: mouseup Handle mouseup.
Parameters: evt - {Event} The browser event
Returns: {Boolean} Allow event propagation
Method: move Handle mousemove and touchmove. 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
Method: register register an event on the map
Method: setEvent With each registered browser event, the handler sets its own evt property. This property can be accessed by controls if needed to get more information about the event that the handler is processing.
This allows modifier keys on the event to be checked (alt, shift, ctrl, and meta cannot be checked with the keyboard handler). For a control to determine which modifier keys are associated with the event that a handler is currently processing, it should access (code)handler.evt.altKey || handler.evt.shiftKey || handler.evt.ctrlKey || handler.evt.metaKey(end).
Parameters: evt - {Event} The browser event.
Method: startTouch
Start touch events, this method must be called by subclasses in
"touchstart" method. When touch events are started
Method: touchend Handle touchend.
Parameters: evt - {Event} The browser event
Returns: {Boolean} Allow event propagation
Method: touchmove Handle touchmove.
Parameters: evt - {Event} The browser event
Returns: {Boolean} Allow event propagation
Method: touchstart Handle touchstart.
Parameters: evt - {Event} The browser event
Returns: {Boolean} Allow event propagation
Method: unregister unregister an event from the map
Method: up Handle mouseup and touchend. 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
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.