[Users] Change order base layers of gx_baselayercontainer

Vidal, Antoni antoni.vidal at icc.cat
Fri Apr 29 14:11:48 CEST 2011


Hi again,

I get the same result. Topo layer above orto and orto selected by default. My intention is to flip actual order and show first and up "Topo" selected by default. Bellow and seccond, "Orto".


My actual code:


    var createLayers = function() {
        return [
		  new OpenLayers.Layer.WMS(
		    // Si es canvia el nom de la capa cal canviar on es cerca la capa base per canviar-la amb map.setBaseLayer
		    lyrOrto, "http://sagitari.icc.cat/tilecache/tilecache.py?",
			{layers: 'orto', format:"image/jpeg"},{isBaseLayer: true, visibility: false}
		  ),
		  new OpenLayers.Layer.WMS(
		    lyrTopo, "http://sagitari.icc.cat/tilecache/tilecache.py?",
			{layers: 'topo', format:"image/jpeg"},{isBaseLayer: true}
		  ),
		.....


Thanks.

Toni.

-----Missatge original-----
De: Sarah Schuessler [mailto:sarah_flip at yahoo.de] 
Enviat: viernes, 29 de abril de 2011 14:01
Per a: Vidal, Antoni; Andreas Hocevar
A/c: users at geoext.org
Tema: AW: [Users] Change order base layers of gx_baselayercontainer

Hi,

Layers.WMS("nameofyourlayerinmap", "urltoyourwms", {layers: "namespace:layer", 
format: "image/png"},{isBaseLayer: true, visibility: true})

HTH
Sarah



----- Ursprüngliche Mail ----

Hi Sarah,

Maybe you can enlighten me. In fact "layers" param doesn't exists in OL docu 
http://dev.openlayers.org/releases/OpenLayers-2.10/doc/apidocs/files/OpenLayers/Layer-js.html
 

What's the correct way?

Thanks in advance.

Toni


-----Missatge original-----
De: Sarah Schuessler [mailto:sarah_flip at yahoo.de] 
Enviat: viernes, 29 de abril de 2011 13:42
Per a: Vidal, Antoni; Andreas Hocevar
A/c: users at geoext.org
Tema: AW: [Users] Change order base layers of gx_baselayercontainer

Hi,

you mixed options and params at your Layer.WMS.

HTH
Sarah



----- Ursprüngliche Mail ----

Hi,

I've done, but the result is the same, and layer continue visible and active.

    var createLayers = function() {
        return [
          new OpenLayers.Layer.WMS(
            lyrOrto, "http://mytilecache.com/tilecache/tilecache.py?",
            {layers: 'orto', format:"image/jpeg", isBaseLayer: true},
            {visibility: false}
          ),
        ....

Thanks,

Toni.

-----Missatge original-----
De: andreas.hocevar at gmail.com [mailto:andreas.hocevar at gmail.com] En nom de 
Andreas Hocevar
Enviat: viernes, 29 de abril de 2011 11:14
Per a: Vidal, Antoni
A/c: users at geoext.org
Tema: Re: [Users] Change order base layers of gx_baselayercontainer

There is currently no option to flip the layer order in
LayerContainers. You can, however, configure one of your base layers
with "visibility: false", so it won't be active.

Hope this helps,
Andreas.

On Tue, Apr 26, 2011 at 6:01 PM, Vidal, Antoni <antoni.vidal at icc.cat> wrote:
> Hi list,
>
>
>
> I've two base layers, they are part of a gx_baselayercontainer nodetype
> inside an Ext.Viewport. These layers are ordered backward that they are
> created. That's my problem because if I change the order when create the
> layers, then active layer is not the one I want.
>
>
>
> Somebody knows how to change the order of base layers in a
> gx_baselayercontainer?
>
>
>
> Thanks in advance.
>
>
>
> Antoni Vidal
>
> Unitat d'Aplicacions SIG-WEB
> Institut Cartogràfic de Catalunya
> Parc de Montjuïc, E-08038 Barcelona
> Tel. (+34) 93 567 15 00 (ext. 3228)
> www.icc.cat
>
>
>
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>
>



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

_______________________________________________
Users mailing list
Users at geoext.org
http://www.geoext.org/cgi-bin/mailman/listinfo/users



More information about the Users mailing list