[Users] Layer group with legend

Alexandre Dube adube at mapgears.com
Tue Oct 19 17:43:39 CEST 2010


Got it.  I'll play with this some more see what I can get.  Thanks again.

Alexandre


On 10-10-19 10:48 AM, Andreas Hocevar wrote:
> 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.
>
>
>    


-- 
Alexandre Dubé
Mapgears
www.mapgears.com



More information about the Users mailing list