Openlayers3: layerswitcher + getfeatureinfo

Openlayers3: layerswitcher + getfeatureinfo

I'm working on a webmapping project which use geoserver and OpenLayers 3 for the vizualisation. I'm stuck when I try to use "WMS GetFeatureInfo" and "LayerSwitcher". Both functions work individually but when I try to combine both it doesn't work anymore. I'm sure I'm on the right way but missing something…

For the GetFeatureInfo I use code like in this example:

and for the LayerSwitcher I have implemented this:

Do I may have to change something in the ol3-layerswitcher.js ?


At the end I like to have a Layerswitcher which can group my layers and it should be possible to use "GetFeatureInfo" for every Layer.

I think this is a duplicate of a question asked on the OL3 Dev list which I provided some input on including linking to an example which demonstrates WMS layers with GetFeatureInfo and includes a LayerSwitcher: