[OpenLayers-Users] Re: Drawing Colored Shapes "The Right Way" (code
sample)
bolosig
bolosig at gmail.com
Tue May 17 03:03:37 EDT 2011
Hi Walt,
Maybe you can use the preFeatureInsert method or the event
beforefeatureadded
Read the doc
http://dev.openlayers.org/releases/OpenLayers-2.10/doc/apidocs/files/OpenLayers/Layer/Vector-js.html#OpenLayers.Layer.Vector.preFeatureInsert
A short example
vector_layer = new OpenLayers.Layer.Vector("Edit layer", {
preFeatureInsert: yourPreFeatureInsert,
styleMap: yourStyle
});
function yourPreFeatureInsert(feature) {
feature.attributes.fillColor = desiredColorFromScopeClosure;
}
Regards,
Bolo
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Drawing-Colored-Shapes-The-Right-Way-tp6360813p6371757.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list