[Users] Error while try to display LegendGraphics in Layer Tree [SEC=Unclassified]

Miles Jordan Miles.Jordan at aad.gov.au
Wed Jul 21 01:58:10 CEST 2010


Jehanzeb Orakzai wrote:
> Hi Miles,
>
> Thank you for the reply.
>
> I have tried this also, but no luck. If u have a working example can
> you post it please.
>
>
> Thank you,

This works for me with Ext 3.0, 3.1 and 3.2.1.

createIconNode = function(attr) {
  var layer_name = ....;
  attr.icon = '/servicesproxy/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=20&HEIGHT=20&LAYER=' + layer_name;
  return GeoExt.tree.LayerLoader.prototype.createNode.call(this, attr);
};

And then the treepanel looks like:

{
  xtype: "treepanel",
  loader: new Ext.tree.TreeLoader({
    applyLoader: false
  }),
  root: {
    nodeType: "async",
    children: {
      nodeType: "gx_overlaylayercontainer",
      text: 'Some Layers',
      layerStore: myLayerStore,
      leaf: false,
      expanded: true,
      loader: {
        createNode: createIconNode
      }
    }
  }
}


Regards,

Miles


___________________________________________________________________________

    Australian Antarctic Division - Commonwealth of Australia
IMPORTANT: This transmission is intended for the addressee only. If you are not the
intended recipient, you are notified that use or dissemination of this communication is
strictly prohibited by Commonwealth law. If you have received this transmission in error,
please notify the sender immediately by e-mail or by telephoning +61 3 6232 3209 and
DELETE the message.
        Visit our web site at http://www.antarctica.gov.au/
___________________________________________________________________________


More information about the Users mailing list