Hi,
Regarding this example:
http://dev.openlayers.org/releases/OpenLayers-2.11/examples/measure.html
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:
function handleMeasurements(event) {
var geometry = event.geometry;
var measure = event.measure;
if (measure.toFixed(3) > 10000){
new_style_properties = {'fillColor':'#FF3300','fillOpacity': .5,
'strokeColor': '#FF3300', 'strokeWidth': 2};
new_style = new OpenLayers.Style();
new_style.addRules([
new OpenLayers.Rule({symbolizer: new_style_properties})
]);
var new_styleMap = new OpenLayers.StyleMap({"default": new_style});
drawControls.handlerOptions.layerOptions = {styleMap: new_styleMap}
}
}
Can we change the layeroptions "on the fly" or it will only consider the
one set at creation time of the control?
regards,
MartinO
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users