[OpenLayers-Users] Visibility of features in vector layer

Stefan Lischke lischke at novacom.net
Tue May 5 08:39:38 EDT 2009


Hi Dave,

That was also exactly my problem. Maybe there is another solution (i also
would like to hear it)
But i used Layer.setVisibility(boolean) to show/hide features. So you have
to put the features on different layers.

Hopefully someone will come up with a better solution

Hth

Stefan

> Hi
> 
> I have a vector layer (OpenLayers.Layer.Vector) and have 
> added a linear feature to it.
> 
> If the user requests to temporarily hide the feature, I do that with:
> layer.drawFeature(feature, { display: "none"}); This works 
> fine except if the user now changes the map zoom level, the 
> linear feature magically re-appears.
> 
> My questions are:
> 1) Am I using the correct technique to hide the feature?
> 2) Is there a trick that will hide the feature at all zoom levels?
> 3) Should I destroy the feature instead of just hiding it?
> 
> Any help appreciated,
> Dave
> --
> View this message in context: 
> http://n2.nabble.com/Visibility-of-features-in-vector-layer-tp
> 2792029p2792029.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> 
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users




More information about the Users mailing list