Hi all,<div><br></div><div>Currently I used this piece of code to allow the user to draw a region of interest on the map:</div><div><br></div><div>drawControls = new OpenLayers.Control(); </div><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><div><div> notice: function(geom) { </div><div> // whatever you want it to do after the box has been drawn</div><div> var feature = new OpenLayers.Feature.Vector(geom);</div>
<div> layer_zone_extraction.addFeatures(feature);</div><div> //afficher la superficie de la zone dessiné</div><div> var bounds = getExtractBounds();</div><div> var ll = new OpenLayers.LonLat(bounds.left, bounds.bottom);</div>
<div> var ur = new OpenLayers.LonLat(bounds.right, bounds.top);</div><div> var superficieKm = Math.abs(((bounds.left-bounds.right)/1000)*((bounds.top-bounds.bottom)/1000));</div><div> $('#message').jGrowl(superficieKm.toFixed(2) + " km²");</div>
<div> }</div><div> }); </div></div><div><br></div><div><div>Is it's possible to display the area value on-the-fly while the user draw it instead of after he finished?</div></div><div><br></div><div>Thanks you in advance!</div>
<div><br></div><div>MartinO</div>