Problem solved.

 

I just used map.getLayer(activeLayerID) instead of the variable.

 

Thank you.

 

From: Jacinto Estima [mailto:jacinto.est...@gmail.com] 
Sent: Wednesday, August 08, 2012 12:09 PM
To: 'Alexandre Dubé'
Cc: users@geoext.org
Subject: RE: [Users] Active layer on top

 

Just to complement my previous email and show you how I am dealing with this
issue.

 

Here is my code:

 

var activeLayer;

       

       // get the active layer.

           var registerRadio = function(node){

               if(!node.hasListener("radiochange")) {

                   node.on("radiochange", function(node){

                     activeLayer = node.layer.name;

                     activeLayerID = node.layer.id;

                     map.raiseLayer(activeLayerID, 1);

                   });

               }

           };

           LayerTree.on({

               "insert": registerRadio,

               "append": registerRadio,

               scope: this

           });

 

This is working to get the legend of the active layer.

 

I am now trying the raiseLayer method but once I am using the layer ID
instead of the variable, I get this error on the console: TypeError:
layer.setZIndex is not a function

 

 

From: Jacinto Estima [mailto:jacinto.est...@gmail.com] 
Sent: Wednesday, August 08, 2012 10:17 AM
To: 'Alexandre Dubé'
Cc: users@geoext.org
Subject: RE: [Users] Active layer on top

 

Thank you very much Alexandre. I really appreciate your help.

 

To use the setLayerIndex I have to provide the variable that holds the
layer.

My problem now is that when I get the active layer I only can get its ID or
Name, but not the name of the variable and I need it to set the Layer Index
to the highest value. Any idea on how to get the variable?

 

Thank you,

Jacinto

 

From: Alexandre Dubé [mailto:ad...@mapgears.com] 
Sent: Tuesday, August 07, 2012 4:16 PM
To: Jacinto Estima
Cc: users@geoext.org
Subject: Re: [Users] Active layer on top

 

Hi Jacinto,

  The following example shows how to listen to the event triggered when a
layer is selected using the radio button.  You can start from there.
    http://api.geoext.org/1.1/examples/tree.html

HTH,

Alexandre


On 12-08-07 02:31 AM, Jacinto Estima wrote:

Just to complement my previous email.

 

My idea is to build a function that reorder the layers and for that I
already have something in mind. My problem is how to call that function
every time the users sets the active layer through the radio button.

 

Thanks again

 

From: Jacinto Estima [mailto:jacinto.est...@gmail.com] 
Sent: Tuesday, August 07, 2012 10:28 AM
To: 'Alexandre Dubé'; 'users@geoext.org'
Subject: RE: [Users] Active layer on top

 

Thanks Alexandre. I think this is what I was looking for.

 

I have now to figure out how to put this working. I have several raster
layers and a lot of users are expected to access them so I cannot go with
the “highest layer number + 1” . I have to find a way to reorganize the
order every time the user sets the active layer through the radio button (I
have radio buttons in the tree nodes to set the active layer).  Do you have
any suggestion?

 

Regards,

Jacinto

 

From: users-boun...@geoext.org [mailto:users-boun...@geoext.org] On Behalf
Of Alexandre Dubé
Sent: Monday, August 06, 2012 4:33 PM
To: users@geoext.org
Subject: Re: [Users] Active layer on top

 

Hi Jacinto,

  The OpenLayers.Map.setLayerIndex may be what you're looking for :
 
http://dev.openlayers.org/releases/OpenLayers-2.12/doc/apidocs/files/OpenLay
ers/Map-js.html#OpenLayers.Map.setLayerIndex

HTH,

Alexandre


On 12-08-06 07:41 AM, Jacinto Estima wrote:

Hi all,

 

I have an Issue to solve as follows: I have several layers on my
application. These layers are organized in subfolders with async tree nodes.
I need to find a way to put the active layer on top of all of the other
layers without moving it.

I was wondering if someone already did that or have the same issue to solve.

 

Thanks for your help.

 

Regards,

Jacinto

 

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

 

-- 
Alexandre Dubé
Mapgears
www.mapgears.com

 

-- 
Alexandre Dubé
Mapgears
www.mapgears.com
_______________________________________________
Users mailing list
Users@geoext.org
http://www.geoext.org/cgi-bin/mailman/listinfo/users

Reply via email to