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
This commit is contained in:
@@ -30,14 +30,13 @@
|
|||||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||||
map.addControl(new OpenLayers.Control.MousePosition());
|
map.addControl(new OpenLayers.Control.MousePosition());
|
||||||
|
|
||||||
var options = {handlerOptions: {freehand: true}};
|
|
||||||
drawControls = {
|
drawControls = {
|
||||||
point: new OpenLayers.Control.DrawFeature(pointLayer,
|
point: new OpenLayers.Control.DrawFeature(pointLayer,
|
||||||
OpenLayers.Handler.Point),
|
OpenLayers.Handler.Point),
|
||||||
line: new OpenLayers.Control.DrawFeature(lineLayer,
|
line: new OpenLayers.Control.DrawFeature(lineLayer,
|
||||||
OpenLayers.Handler.Path, options),
|
OpenLayers.Handler.Path),
|
||||||
polygon: new OpenLayers.Control.DrawFeature(polygonLayer,
|
polygon: new OpenLayers.Control.DrawFeature(polygonLayer,
|
||||||
OpenLayers.Handler.Polygon, options)
|
OpenLayers.Handler.Polygon)
|
||||||
};
|
};
|
||||||
|
|
||||||
for(var key in drawControls) {
|
for(var key in drawControls) {
|
||||||
@@ -93,11 +92,14 @@
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
<p>Feature digitizing is in freehand mode by default. In freehand mode, the mouse is treated as a pen.
|
<p>With the point drawing control active, click on the map to add a point. You can drag the point
|
||||||
Drawing begins on mouse down, continues with every mouse move, and ends with mouse up.</p>
|
before letting the mouse up if you want to adjust the position.</p>
|
||||||
<p>To turn freehand mode off, hold down the shift key while digitizing. With freehand mode off, one
|
<p>With the line drawing control active, click on the map to add the points that make up your line.
|
||||||
vertex is added with each click and double-clicks finish drawing. Freehand mode can be toggled on and off
|
Double-click to finish drawing.</p>
|
||||||
at any time while drawing.</p>
|
<p>With the polygon drawing control active, click on the map to add the points that make up your
|
||||||
|
polygon. Double-click to finish drawing.</p>
|
||||||
|
<p>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.<p>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user