This is not my code (but it&#39;s working for me).<div><br></div><div><div>drawControls = new OpenLayers.Control(); </div><div>      OpenLayers.Util.extend(drawControls, { </div><div>          draw: function() { </div><div>
              this.box = new OpenLayers.Handler.RegularPolygon(drawControls,</div><div>              {&quot;done&quot;: this.notice}, {sides:4, irregular:true, persist:true});</div><div>            }, </div><div>           notice: function(geom) { </div>
<div>            // whatever you want it to do after the box has been drawn</div><div>           }</div><div>        }); </div><div><br></div><div>      // then add the boxControl to the map </div><div>      map.addControl(drawControls);</div>
<div><br></div>MartinO</div><div><br><div class="gmail_quote">On Fri, Nov 18, 2011 at 6:11 AM, Steve <span dir="ltr">&lt;<a href="mailto:thesteveborland@gmail.com">thesteveborland@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">Puneet Kishor &lt;punk.kish@...&gt; writes:<br>
<br>
&gt;<br>
&gt; I am trying to implement a control to draw non-rotatable rectangles on the<br>
map. The following code draws<br>
&gt; squares only, and with &quot;snapAngle&quot; at 0, it can be rotated freely, while with<br>
&quot;snapAngle&quot; at 360 the square<br>
&gt; is rotated by 45 deg, for some reason.<br>
&gt;<br>
&gt;       var feature_ctl = new OpenLayers.Control.DrawFeature(<br>
&gt;               vectorLayer,<br>
&gt;               OpenLayers.Handler.RegularPolygon, {handlerOptions: {sides: 4, snapAngle: 0}}<br>
&gt;         );<br>
&gt;<br>
&gt; Would appreciate guidance on how I can make the control draw only<br>
non-rotatable rectangles.<br>
&gt;<br>
&gt; --<br>
&gt; Puneet Kishor<br>
<br>
<br>
</div>I am having the same problem.<br>
Any help would be appreciated.<br>
<br>
Many thanks,<br>
<span class="HOEnZb"><font color="#888888">Steve<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
</div></div></blockquote></div><br></div>