[Users] Adding legend image to tree panel?

Andreas Hocevar ahocevar at opengeo.org
Mon Jul 30 10:15:26 CEST 2012


Yes, this is possible. See
http://api.geoext.org/1.1/examples/tree-legend.html for an example.

Andreas.

On Sat, Jul 28, 2012 at 10:46 PM, Jason Woolard <jason.woolard at noaa.gov> wrote:
> Hi,
>
> Is it possible to use gx_legendimage within a tree config? I'd like to just
> add a single static legend graphic below a layer in the tree.
> This is what I was unsuccessfully trying.
>
>     var treeConfig = [
>
>          { nodeType: "gx_baselayercontainer",
>            text: 'Base Layers',
>            expanded: false,
>            loader: {
>                       filter: function(rec) {
>                              return (rec.get("layer").options.group ==
> "baselyrs");
>                    }
>            }
>         },
>         { nodeType: "gx_layercontainer",
>           text: 'Vector',
>           expanded: true,
>           loader: {
>                   filter: function(rec){
>                         return (rec.get('layer').options.group ==
> "veclyrs");
>                   },
>                   baseAttrs: {
>                       uiProvider: "custom_ui"
>                   },
>                   createNode: function(attr) {
>
>                     attr.component = {
>                         xtype: "gx_legendimage",
>                         defaultImgSrc: "image1.JPG",
>                         url: "image1.JPG"
>                    }
>                   return
> GeoExt.tree.LayerLoader.prototype.createNode.call(this, attr);
>
>                 }
>
>            }
>      }.......More Layers]
>
> Thanks!
>
>
> _______________________________________________
> 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.


More information about the Users mailing list