GeoPrisma logo


This widget is directly taken from the GeoExt.ux eXtensions. It’s a LayerTree widget that automatically creates its nodes every time a new OpenLayers.Layer object is added to the map.


  • The widget checks the ‘group’ property of the and put a new LayerNode object in the tree. If any nodes don’t exist, it creates them first.
  • WMS layer nodes send ‘GetLegendGraphic’ requests when toggled visible.
  • Base layers without ‘group’ property are added to a “Base layers” node
  • Other layers without ‘group’ property are added to a “Other layers” node.
  • If ‘group’ is set to “”, the layer is added to the root of the tree.

XML Sample

Sample configuration.


How to ‘draw’ the widget

This widget must be drawn using the drawWidgets method : drawWidget / drawWidgets

Mandatory Options

There are no mandatory options for this widget.

Optional Options

Any Ext.tree.TreePanel property is a valid option for this widget.

wmsLegendNodes:(Boolean) Defaults to ‘true’. Whether wms layer nodes should display a legend or not.
 (Boolean) Defaults to ‘true’. Whether vectro layer nodes should display a legend or not.

Notes and warnings


Don’t use hashtable objects when creating your Ext objects in your template.xslt file. This widget doesn’t work with them. Directly instanciate the objects instead.

Don’t :

var oCenterPanel = { xtype: 'panel', ... };

Do :

var oCenterPanel = new Ext.Panel({ ... });


When using this widget with the Map widget, you must set ‘addLayers’ map option to ‘false’ and manually add them after the creation of the GeoExt.MapPanel widget and after the printWidgetExecution template call.

Here’s an example on how to do so :

<xsl:variable name="pstrMapName">
  <xsl:value-of select="/geoprisma/widgets/widget[./type = 'map']/name"></xsl:value-of>
<xsl:call-template name="map:addLayers" >
  <xsl:with-param name="pMapName">
    <xsl:value-of select="$pstrMapName"></xsl:value-of>


Avoid using tilecache services without the ‘staticCache’ option set to true. Layers without this option are created as ‘WMS’, which make them send ‘GetLegendGraphic’ requests that never return anything when they become visible.

Service Type


Widget Action


Table Of Contents

Previous topic


Next topic


This Page