[OpenLayers-Users] Draw Feature from Form field

Eric Lemoine eric.c2c at gmail.com
Sun Jun 1 08:19:43 EDT 2008


On Wed, May 28, 2008 at 12:54 PM, Levii Smith <smithlev at levii.com> wrote:
>
>
> I'm looking to allow someone to enter a lat/long and distance in NM into a
> form field, which would then draw a circle as a vector on screen at that
> location…

Check out the OpenLayers.Geometry.Polygon.createRegularPolygon func:

<http://dev.openlayers.org/releases/OpenLayers-2.6/doc/apidocs/files/OpenLayers/Geometry/Polygon-js.html#OpenLayers.Geometry.Polygon.createRegularPolygon>

> I'd also like to be able to destroy that feature with a
> double-click or something.  Anyone done anything like this, or got a good
> starting point for me?

You can use the select feature control to allow your users to select
features. Then, you can add a button which on click will destroy the
selected feature(s). Your button may be be based on
OpenLayers.Control.Button.

Hope this helps,

--
Eric


More information about the Users mailing list