[Users] gx_layer display in gx_overaylayercontainer

Andreas Hocevar ahocevar at opengeo.org
Mon Nov 23 16:53:49 CET 2009


Sascha Müller wrote:
> Hi,
> 
> I had this before, but with this way, the layers don't show up in the 
> legend.
> That's why I used 'displayInLayerSwitcher: true'. Is there a way get 
> both thing a the same time?

Yes. Instead of an OverlayLayerContainer, use a LayerContainer, and 
configure it with a LayerLoader with the following filter property:

filter: function(record) {
     var layer = record.get("layer");
     return (!layer.isBaseLayer && layer.name != "Strassennetz");
}

Regards,
Andreas.

> 
> Regards,
> 
> Sascha
> 
>> Sascha Müller wrote:
>>> Hi,
>>>
>>> I try to use a GroupLayer like in the examples. My problem is, that 
>>> the GroupLayer is shown in the OverlayLayer Node.
>>>
>>> map.addLayer(new OpenLayers.Layer.WMS("Strassennetz",
>>>         "http://localhost:8081/geoserver/wms", {
>>>                  layers: [
>>>                      "Autobahnen",
>>>                      "Fernstrassen",
>>>                      "Verbindungsstrassen",
>>>                      "Wohnstrassen"
>>>                  ],
>>>                  transparent: true,
>>>                  format: "image/gif"
>>>         }, {
>>>                  isBaseLayer: false,
>>>                  buffer: 0,
>>>                  displayInLayerSwitcher: true,
>>>   
>>
>> Set displayInLayerSwitcher to false, and you should be fine.
>>
>> Regards,
>> Andreas.
>>
>>
> 


-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.


More information about the Users mailing list