Thanks Andreas. That is the example I was hacking on and had a small bug 
in my test code. It is pretty easy to replace  "gx_wmslegend" with  
"gx_legendimage"
in the CreateNode function to create a static legend in a tree.

Sorry for that!

Thanks again.

On 7/30/2012 4:15 AM, Andreas Hocevar wrote:
> 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.wool...@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@geoext.org
>> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>>
>
>
_______________________________________________
Users mailing list
Users@geoext.org
http://www.geoext.org/cgi-bin/mailman/listinfo/users

Reply via email to