[OpenLayers-Users] Quickly hiding and showing features

Eric Lemoine eric.lemoine at camptocamp.com
Thu Apr 30 15:06:30 EDT 2009


Hi

You can use layer.drawFeature(feature, {display: "none"}); to hide a feature.



On Thursday, April 30, 2009, Nicholas Bergson-Shilcock
<nicholasbs at openplans.org> wrote:
> Excerpts from Heidt, Christopher M.'s message of Wed Apr 29 13:00:48 -0400 2009:
>> You can also play with the feature style.
>> You can make a 'hidden' style that turns the opacity down to 0.
>> Then your slider could change the render intent on certain features.
>>
>
> Thanks for the suggestions guys. I'm just adding and removing the features for now,
> but I may experiment with breaking them on to separate layers and changing
> their visibility later
>
>> It really just depends on if your are trying to hide a bunch at once or a few
>> at a time.
>>
>> -----Original Message-----
>> From: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] On Behalf Of Stefan Lischke
>> Sent: Wednesday, April 29, 2009 12:51 PM
>> To: 'Nicholas Bergson-Shilcock'; 'OpenLayers users mailing list'
>> Subject: Re: [OpenLayers-Users] Quickly hiding and showing features
>>
>> Hi Nicholas,
>>
>> I had the same problem some minutes ago and i put my features on different layers and for every "slider step" i hide/show a corresponding layer. I did this whith calling layer.setVisibility()
>>
>> Hth
>>
>> Stefan
>>
>> -----Ursprüngliche Nachricht-----
>> Von: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im Auftrag von Nicholas Bergson-Shilcock
>> Gesendet: Mittwoch, 29. April 2009 18:11
>> An: OpenLayers users mailing list
>> Betreff: [OpenLayers-Users] Quickly hiding and showing features
>>
>> I have a slider whose value I would like to link directly to what vector features appear on my map (i.e., as the user moves the slider, I would like certain features to appear/disappear).
>>
>> Is the best way to do this to simply call add/removeFeatures on the layer, or is there a way for me to only toggle their visibility?
>>
>> Thanks,
>>   -Nicholas
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users
>>
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com



More information about the Users mailing list