[Users] [TreeConfig][LayerNode.js] getVisibility is not a function

Bart van den Eijnden (OSGIS) bartvde at osgis.nl
Thu Nov 11 12:33:06 CET 2010


Let me clarify additonally, so if you use a string for layer, you need to
use:

layer: "Lindes"

if you want to refer to the layer object, then use the variable name so
without quotes:

layer: lindes

Best regards,
Bart

> Hi,
>
> layer should be pointing to the layer's name, so Lindes and Base and not
> lindes and catastro.
>
> Best regards,
> Bart
>
>> Hello,
>>
>> I'm still fighting with TreeMenu panel. This is my code written from the
>> ground:
>>
>>          var lindes = new OpenLayers.Layer.WMS(
>>              "Lindes",
>>              "http://getcloud.info:8080/geoserver/wms",
>>             {
>>                  layers: "lindes",
>>                  format: "image/png",
>>                  transparent:true
>>              },
>>              {isBaseLayer: true, singleTile: true, visibility: true}
>>          );
>>
>>          var catastro = new OpenLayers.Layer.WMS(
>>              "Base",
>>              "http://getcloud.info:8080/geoserver/wms",
>>             {
>>                  layers: "ao:Catastro",
>>                  format: "image/png",
>>                  transparent:true
>>              },
>>              {isBaseLayer: true, singleTile: true, visibility: true}
>>          );
>>
>>          var treeMenu = [
>>          {
>>                  id:'1',
>>                  text: 'Base',
>>                  leaf: false,
>>                  children: [
>>                          {id:'11', nodeType: "gx_layer", layer:
>> "lindes", leaf:true},
>>                          {id:'12', nodeType: "gx_layer", layer:
>> "catastro", leaf:true}
>>                  ]
>>          }
>>          ]
>>
>>          // create the tree with the configuration from above
>>          tree = new Ext.tree.TreePanel({
>>              border: true,
>>              region: "west",
>>              title: "Capas",
>>              width: 200,
>>              split: true,
>>              collapsible: true,
>>              expanded: true,
>>              root: {
>>                  nodeType: "async",
>>                  text: "AgroOffice",
>>                  children: treeMenu
>>              }
>>          });
>>
>> I can open AgroOffice root, but when trying to open the Base Group the
>> console error tells me:
>>
>> Error: this.node.layer.getVisibility is not a function
>> Archivo de origen:
>> http://ao.getcloud.info/GeoExt/lib/GeoExt/widgets/tree/LayerNode.js
>> Línea: 30
>>
>> I'm really missed, what can I do?
>>
>> Best wishes,
>>
>> _______________________________________________
>> Users mailing list
>> Users at geoext.org
>> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>>
>
>
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>




More information about the Users mailing list