<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16788" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff><FONT face=Arial size=2><FONT size=2>
<DIV>Hi All,</DIV>
<DIV>&nbsp;</DIV>
<DIV>I use the following code for handling point and rectangle creation. It 
works fine. Now, how can&nbsp;one round-off coordinates of the feature geometry 
before&nbsp;it is created (for point and rectangle)? And also, how can one 
restrict&nbsp;the drawing of a rectangle </DIV>
<DIV>to discreet sizes?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Stephane</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>P.S.: considering the standard point and rectangle handler code</DIV>
<DIV>&nbsp;</DIV>
<DIV>drawControls = <BR>{ <BR>&nbsp;&nbsp;&nbsp; point: new 
OpenLayers.Control.DrawFeature(rectangleLayer,<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; OpenLayers.Handler.Point, {featureAdded: 
point_feature_added, handlerOptions: {<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; createFeature: function() { 
this.control.layer.destroyFeatures(); <BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; OpenLayers.Handler.Point.prototype.createFeature.apply(this, 
arguments);}}}),<BR>&nbsp;&nbsp;&nbsp; rectangle: new 
OpenLayers.Control.DrawFeature(rectangleLayer,<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; OpenLayers.Handler.RegularPolygon, 
{featureAdded: rectangle_feature_added,<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; handlerOptions: { sides: 4, irregular: true, 'displayClass': 
'olControlDrawFeatureRectangle',<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; createGeometry: function() { 
this.control.layer.destroyFeatures(); <BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; 
OpenLayers.Handler.RegularPolygon.prototype.createGeometry.apply(this, 
arguments);}}})&nbsp;<BR>}; <BR><BR>for(var key in drawControls) 
<BR>{<BR>&nbsp;&nbsp;&nbsp; map.addControl(drawControls[key]);<BR>} 
<BR></DIV></FONT></FONT></BODY></HTML>