<!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> </DIV>
<DIV>I use the following code for handling point and rectangle creation. It
works fine. Now, how can one round-off coordinates of the feature geometry
before it is created (for point and rectangle)? And also, how can one
restrict the drawing of a rectangle </DIV>
<DIV>to discreet sizes?</DIV>
<DIV> </DIV>
<DIV>Stephane</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>P.S.: considering the standard point and rectangle handler code</DIV>
<DIV> </DIV>
<DIV>drawControls = <BR>{ <BR> point: new
OpenLayers.Control.DrawFeature(rectangleLayer,<BR>
OpenLayers.Handler.Point, {featureAdded:
point_feature_added, handlerOptions: {<BR>
createFeature: function() {
this.control.layer.destroyFeatures(); <BR>
OpenLayers.Handler.Point.prototype.createFeature.apply(this,
arguments);}}}),<BR> rectangle: new
OpenLayers.Control.DrawFeature(rectangleLayer,<BR>
OpenLayers.Handler.RegularPolygon,
{featureAdded: rectangle_feature_added,<BR>
handlerOptions: { sides: 4, irregular: true, 'displayClass':
'olControlDrawFeatureRectangle',<BR>
createGeometry: function() {
this.control.layer.destroyFeatures(); <BR>
OpenLayers.Handler.RegularPolygon.prototype.createGeometry.apply(this,
arguments);}}}) <BR>}; <BR><BR>for(var key in drawControls)
<BR>{<BR> map.addControl(drawControls[key]);<BR>}
<BR></DIV></FONT></FONT></BODY></HTML>