[Users] Layer group with legend

Andreas Hocevar ahocevar at opengeo.org
Tue Oct 19 16:48:37 CEST 2010


On Oct 19, 2010, at 15:56 , Alexandre Dube wrote:

> Andreas,
> 
>  Thanks again for your support.
> 
> On 10-10-19 09:41 AM, Andreas Hocevar wrote:
>> You are calling the wrong superclass. You need
>> GeoExt.tree.LayerParamLoader.prototype.createNode.call(this, attr);
>>   
> 
> Got it.  Now it's working but with one remaining issue : the WMSLegend is the same for all nodes.  If I have the 4 paramNodes checked, I get 4 icons under each one instead of the specific one per layer (and it figures, because that's what it's configured to do).  You can see for yourself by replacing the mapPanel and tree in the tree-legend example with these [1].
> 
> So, I need to configure the WMSLegend to use a single param layer value (haven't checked, but I don't know if that's possible).

Oh, I forgot to comment on that part. I'd recommend creating an ImageLegend instance rather than a WMSLegend one, so you can create a custom URL using layer.url, Ext.urlDecode/urlEncode and Ext.urlAppend.

> 
>>> Secondly, I about my other "group" node level thing, I'm not sure if
>>> that's currently possible with the current elements unless I create the
>>> nodes manually, am I right ?
>>>     
>> You could use a LayerLoader with a filter for each of your groups. At least that's what I hear other people do.
>>   
> 
> Do you have any example to share ?

Not immediately. But search the list for tree group filter - there were some posts about this about a month ago. The idea is to use the filter property of the loader (http://geoext.org/lib/GeoExt/widgets/tree/LayerLoader.html), and give your layers some information about the group they belong to (either in layer.metadata or in an additional field of a customized LayerStore) that you can filter against.

Regards,
Andreas.


-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.



More information about the Users mailing list