Ulao,
<P/>
I ran into this a while back, and here's my understanding of what's going on with OpenLayers, though I'm willing to defer to any experts that state otherwise.
<P/>
In order to manipulate an OpenLayers map, you need to "<A HREF="http://dev.openlayers.org/docs/files/OpenLayers/Map-js.html#OpenLayers.Map.addControl" target="_top" rel="nofollow" link="external">add</A>" a <A HREF="http://dev.openlayers.org/docs/files/OpenLayers/Control-js.html" target="_top" rel="nofollow" link="external">Control</A> to it.  Controls sit dormant until <A HREF="http://dev.openlayers.org/docs/files/OpenLayers/Control-js.html#OpenLayers.Control.activate" target="_top" rel="nofollow" link="external">activated</A>, then they do their thing, and stop when <A HREF="http://dev.openlayers.org/docs/files/OpenLayers/Control-js.html#OpenLayers.Control.deactivate" target="_top" rel="nofollow" link="external">deactivated</A>.
<P/>
The control you're interested in is the <A HREF="http://dev.openlayers.org/docs/files/OpenLayers/Control/DrawFeature-js.html" target="_top" rel="nofollow" link="external">DrawFeature</A> control which adds <A HREF="http://dev.openlayers.org/docs/files/OpenLayers/Feature-js.html" target="_top" rel="nofollow" link="external">features</A> to a map.
<P/>
A map consists of <A HREF="http://dev.openlayers.org/docs/files/OpenLayers/Layer-js.html" target="_top" rel="nofollow" link="external">layers</A>, so you'll need to tell the control which layer the feature will be drawn to, usually done by specifying the layer in the constructor.
<P/>
<EM>What kind of shape</EM> is determined by the <A HREF="http://dev.openlayers.org/docs/files/OpenLayers/Handler-js.html" target="_top" rel="nofollow" link="external">Handler</A> you pass to the DrawFeature control.  While it is possible to write your own, it's more than likely one already exists that does what you want.
<P/>
A handler watches mouse events and interprets them a certain way.  Two separate clicks could be a line segment, a rectangle's opposite corners, or several ways to define a circle.  Often the same handler can perform different tasks just based on the options passed to it.
<P/>
This <A HREF="http://openlayers.org/dev/examples/modify-feature.html" target="_top" rel="nofollow" link="external">drawing example</A> has a superb number of shapes, all produced fairly simply.  You'll note that a "circle" is actual a <A HREF="http://dev.openlayers.org/docs/files/OpenLayers/Handler/RegularPolygon-js.html" target="_top" rel="nofollow" link="external">regular polygon</A> with 40+ sides.
<P/>
Hope this helps,<BR/>
Walt Stoneburner

        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://osgeo-org.1803224.n2.nabble.com/drawing-a-box-or-circle-tp6373056p6373359.html">Re: drawing a box or circle</a><br/>
Sent from the <a href="http://osgeo-org.1803224.n2.nabble.com/OpenLayers-Users-f1822463.html">OpenLayers Users mailing list archive</a> at Nabble.com.<br/>