From cd899ab11efd1fb72b3bd9e4225111c5b99e68ca Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Thu, 26 Mar 2009 15:35:11 +0000 Subject: [PATCH] Changing the draw feature example to use the default drawing behavior. To enable freehand drawing, use the shift key. git-svn-id: http://svn.openlayers.org/trunk/openlayers@9135 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- examples/draw-feature.html | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/examples/draw-feature.html b/examples/draw-feature.html index f133ee93e9..2affeba8b0 100644 --- a/examples/draw-feature.html +++ b/examples/draw-feature.html @@ -30,14 +30,13 @@ map.addControl(new OpenLayers.Control.LayerSwitcher()); map.addControl(new OpenLayers.Control.MousePosition()); - var options = {handlerOptions: {freehand: true}}; drawControls = { point: new OpenLayers.Control.DrawFeature(pointLayer, OpenLayers.Handler.Point), line: new OpenLayers.Control.DrawFeature(lineLayer, - OpenLayers.Handler.Path, options), + OpenLayers.Handler.Path), polygon: new OpenLayers.Control.DrawFeature(polygonLayer, - OpenLayers.Handler.Polygon, options) + OpenLayers.Handler.Polygon) }; for(var key in drawControls) { @@ -93,11 +92,14 @@
-

Feature digitizing is in freehand mode by default. In freehand mode, the mouse is treated as a pen. - Drawing begins on mouse down, continues with every mouse move, and ends with mouse up.

-

To turn freehand mode off, hold down the shift key while digitizing. With freehand mode off, one - vertex is added with each click and double-clicks finish drawing. Freehand mode can be toggled on and off - at any time while drawing.

+

With the point drawing control active, click on the map to add a point. You can drag the point + before letting the mouse up if you want to adjust the position.

+

With the line drawing control active, click on the map to add the points that make up your line. + Double-click to finish drawing.

+

With the polygon drawing control active, click on the map to add the points that make up your + polygon. Double-click to finish drawing.

+

Hold down the shift key while drawing to activate freehand mode. While drawing lines or polygons + in freehand mode, hold the mouse down and a point will be added with every mouse movement.