I am taking the context and taking it to a canvas which was asked here and the answer can be found in this JSfiddle example.
However, I am looking to load a WMS layer from geoserver and extract only this WMS layer to make a process and display something on canvas.On Openlayers 2 it could be done with layerContainerDiv extracting the element that contains all the layers and taking the required one.But it seems that in Openlayers 3 cannot be done. I have tried something similar to this example (take into account that this example gives a cross-origin error, but not in my server), but without success as all the layers are processed and cannot be distinguished.
Does someone know how can layers can be distinguished or separated to process them independently?
I found the Layer Spy Example which it seems that making use of precompose and postcompose maybe there could be a way to do it, but no idea...
أكثر...

However, I am looking to load a WMS layer from geoserver and extract only this WMS layer to make a process and display something on canvas.On Openlayers 2 it could be done with layerContainerDiv extracting the element that contains all the layers and taking the required one.But it seems that in Openlayers 3 cannot be done. I have tried something similar to this example (take into account that this example gives a cross-origin error, but not in my server), but without success as all the layers are processed and cannot be distinguished.

Does someone know how can layers can be distinguished or separated to process them independently?
I found the Layer Spy Example which it seems that making use of precompose and postcompose maybe there could be a way to do it, but no idea...
أكثر...