[OpenLayers-Users] Possible to change feature style before adding feature collection?

Roald de Wit roald.dewit at lisasoft.com
Wed Nov 18 20:20:15 EST 2009


Hi,

On 19/11/09 10:51, adsaero wrote:
> I've got a collection of features (FeatureCollection) returned from a server,
> and I'd like to change the style of, say, the first feature in the
> collection to have "stroke" set to true... but I'd like the rest of the
> features to use the default style(s).
>
> Can this be done?  If so, what's the best way to do it?
>
You can listen to the 'beforefeaturesadded' event [1] and manipulate the
features you like before they get added to the layer.

[1]
http://dev.openlayers.org/apidocs/files/OpenLayers/Layer/Vector-js.html#OpenLayers.Layer.Vector.EVENT_TYPES

Regards, Roald

--
Roald de Wit
Software Engineer
roald.dewit at lisasoft.com

Commercial Support for Open Source GIS Software
http://lisasoft.com/LISAsoft/SupportedProducts/



The contents of this email are confidential and may be subject to legal or professional privilege and copyright. No representation is made that this email is free of viruses or other defects. If you have received this communication in error, you may not copy or distribute any part of it or otherwise disclose its contents to anyone. Please advise the sender of your incorrect receipt of this correspondence.



More information about the Users mailing list