[OpenLayers-Users] displayInLayerSwitcher option

andy aborruso at tin.it
Fri Apr 27 11:39:51 EDT 2007


Hi Erik,
thank you very very much.

It's all ok.

best regards,

a

Erik Uzureau ha scritto:
> Actually, I think the problem is that you are passing 
> displayInLayerSwitcher as a parameter istead of as an option. The 
> parameter values get added to the WMS request string, whereas the 
> options values get added to the javascript layer object itself. Maybe 
> give this a try:
>
> var params = {
>     'layers': "mylayer",
>     'format': "'image/png"
> };
> var options = {
>     'displayInLayerSwitcher': false,
>     'isBaseLayer': false
> };
> var myvar= new OpenLayers.Layer.WMS( "Mylayername",
>                                                                            
> "http://mywmsserver/wms?",
>                                                                            
> params,
>                                                                            
> options);
>
> On 4/27/07, *Eric Lemoine* <Eric.Lemoine at camptocamp.com 
> <mailto:Eric.Lemoine at camptocamp.com>> wrote:
>
>     On 4/27/07, andy <aborruso at tin.it <mailto:aborruso at tin.it>> wrote:
>     > Hi all,
>     > another stupid question. I would like to hide a layer in the
>     > layerswitcher. I know I can use displayInLayerSwitcher option, but
>     > probably my lack of javascript knowledge is too big.
>     >
>     > I have tried with unsuccess with this kind of syntax (openlayers
>     2.3):
>     > "var myvar= new OpenLayers.Layer.WMS( "Mylayername",
>     > "http://mywmsserver/wms?", {layers: 'mylayer', format:
>     > 'image/png',displayInLayerSwitcher: 'false'},{isBaseLayer: false});"
>     >
>     > Which is the right way to hide a layer from LayerSwitcher?
>     >
>     > Thank you for all your dev and support job,
>
>     Hi Andy,
>
>     Try removing the quotes around false, in the same way as isBaseLayer.
>
>
>     --
>     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
>     <mailto:eric.lemoine at camptocamp.com>
>     http://www.camptocamp.com
>     _______________________________________________
>     Users mailing list
>     Users at openlayers.org <mailto:Users at openlayers.org>
>     http://openlayers.org/mailman/listinfo/users
>
>
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition. 
> Version: 7.5.463 / Virus Database: 269.6.1/777 - Release Date: 26/04/2007 15.23
>   




More information about the Users mailing list