[fusion-users] Get layer name from Legend right-click

Mike Adair madair at dmsolutions.ca
Thu Apr 15 09:52:24 EDT 2010


Tom,

The menu items are only bound to the legend tree items/folders at this 
point.  I think what you would need to do is bind whatever object you 
need when setting up your onclick event, eg. the existing code looks like:
                    onClick: 
OpenLayers.Function.bind(this.collapseBranch, this, this.oRoot)

but you probably want:

                    onClick: 
OpenLayers.Function.bind(this.collapseBranch, this, this.oRoot, layer)

(or similar) and then in the method being bound, layer will appear as 
one of the arguments.


Mike


Tom van der Putte wrote:
> Hi All,
>
> When right-clicking an item in the legend, a context manu appears. 
> I've added a entry to this menu, and clicking on it results in a 
> certain function beeing executed. However, I want to check if the item 
> that was right-clicked in the legend is of a certain type. How can I 
> get to the layer name? I found something like targetFolder in the 
> legend widget, but this obviously goes only for the folders?
>
> Cheers,
>
> Tom
> ------------------------------------------------------------------------
>
> _______________________________________________
> fusion-users mailing list
> fusion-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/fusion-users
>   

-- 
   Michael Adair
   Senior Software Architect
   DM Solutions Group Inc.

   Office: (613) 565-5056 x26
   madair at dmsolutions.ca
   http://www.dmsolutions.ca
   http://research.dmsolutions.ca




More information about the fusion-users mailing list