This wonderful piece of code allows you to create a magnifying glass on a map !
In this magnifying glass you can have several layer and you will see them alternatively thanks to a shift of opacity.
The magnifying glass is based on the code of Jean-Marc VIGLINO.
https://viglino.github.io/ol-ext/examples/misc/map.overlay.magnify.html
The shifting of opacity between layers was made for a small project.
How to use it ?
Download the index.html and the js files. Open it in your browser.
It is made as an API. The version without API is magnifyingGlassOl.html.