Hi,<br><br>Regarding this example:<br><a href="http://dev.openlayers.org/releases/OpenLayers-2.11/examples/measure.html">http://dev.openlayers.org/releases/OpenLayers-2.11/examples/measure.html</a><br><br>I've tried to change the styling "on the fly" (while setImmediate(true)) if the area exceed a certain value with something like this but it's not working:<div>
<div><br></div><div>function handleMeasurements(event) {</div><div> var geometry = event.geometry;</div><div> var measure = event.measure;</div><div> if (measure.toFixed(3) > 10000){</div><div> new_style_properties = {'fillColor':'#FF3300','fillOpacity': .5, 'strokeColor': '#FF3300', 'strokeWidth': 2};</div>
<div> new_style = new OpenLayers.Style();</div><div> new_style.addRules([</div><div> new OpenLayers.Rule({symbolizer: new_style_properties})</div><div> ]);</div><div> var new_styleMap = new OpenLayers.StyleMap({"default": new_style});</div>
<div> drawControls.handlerOptions.layerOptions = {styleMap: new_styleMap}</div><div> }</div><div>}</div></div><div><br></div><div>Can we change the layeroptions "on the fly" or it will only consider the one set at creation time of the control?</div>
<div><br></div><div>regards,</div><div><br></div><div>MartinO<br><br></div>