Handler to draw a path on the map. Path is displayed on mouse down, moves on mouse move, and is finished on mouse up.
OpenLayers. Handler.Path | Handler to draw a path on the map. |
Properties | |
line | {OpenLayers.Feature.Vector} |
freehand | {Boolean} In freehand mode, the handler starts the path on mouse down, adds a point for every mouse move, and finishes the path on mouse up. |
freehandToggle | {String} If set, freehandToggle is checked on mouse events and will set the freehand mode to the opposite of this.freehand. |
Constructor | |
OpenLayers. Handler.Path | Create a new path hander |
Functions | |
createFeature | Add temporary geometries |
destroyFeature | Destroy temporary geometries |
destroyPoint | Destroy the temporary point. |
addPoint | Add point to geometry. |
freehandMode | Determine whether to behave in freehand mode or not. |
modifyFeature | Modify the existing geometry given the new point |
drawFeature | Render geometries on the temporary layer. |
getGeometry | Return the sketch geometry. |
mousedown | Handle mouse down. |
mousemove | Handle mouse move. |
mouseup | Handle mouse up. |
dblclick | Handle double-clicks. |
Create a new path hander
control | {OpenLayers.Control} |
callbacks | {Object} An object with a ‘done’ property whos value is a function to be called when the path drawing is finished. The callback should expect to recieve a single argument, the line string geometry. If the callbacks object contains a ‘point’ property, this function will be sent each point as they are added. 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 |
Add temporary geometries
createFeature: function()
Destroy temporary geometries
destroyFeature: function()
Destroy the temporary point.
destroyPoint: function()
Add point to geometry.
addPoint: function()
Determine whether to behave in freehand mode or not.
freehandMode: function( evt )
Modify the existing geometry given the new point
modifyFeature: function()
Render geometries on the temporary layer.
drawFeature: function()
Return the sketch geometry.
getGeometry: function()
Handle mouse down.
mousedown: function( evt )
Handle mouse move.
mousemove: function ( evt )
Handle mouse up.
mouseup: function ( evt )
Handle double-clicks.
dblclick: function( evt )