This is not my code (but it'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> {"done": 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"><<a href="mailto:thesteveborland@gmail.com">thesteveborland@gmail.com</a>></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 <punk.kish@...> writes:<br>
<br>
><br>
> I am trying to implement a control to draw non-rotatable rectangles on the<br>
map. The following code draws<br>
> squares only, and with "snapAngle" at 0, it can be rotated freely, while with<br>
"snapAngle" at 360 the square<br>
> is rotated by 45 deg, for some reason.<br>
><br>
> var feature_ctl = new OpenLayers.Control.DrawFeature(<br>
> vectorLayer,<br>
> OpenLayers.Handler.RegularPolygon, {handlerOptions: {sides: 4, snapAngle: 0}}<br>
> );<br>
><br>
> Would appreciate guidance on how I can make the control draw only<br>
non-rotatable rectangles.<br>
><br>
> --<br>
> 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>