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

Roald de Wit roald.dewit at lisasoft.com
Wed Nov 18 23:58:31 EST 2009


Hi,

On 19/11/09 14:27, adsaero wrote:
> When I try that, it seems the feature doesn't render at all.  I also tried
> setting the style in the feature object before adding the feature, but I get
> the same result.
>
That is a bit odd. What happens when you give your track_layer no
style*map* at all?
I think the problem might be in the combination of your stylemap and
your newly created style for that feature.

Btw: isn't there any way you can use a stylemap with rules? If there is
a specific attribute in your first feature that differentiates itself
from the other(s), then you would not need to use the
beforefeaturesadded event at all.

> This also fails, with the same result:
>
> testfeatures = geojson_format.read(results);
> testfeatures[0].style = tracks_style;
> track_layer.addFeatures(poofeatures);
>
I assume you meant to say in your last line:

track_layer.addFeatures(testfeatures);

?

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