Hi,
OCG layers are used to create interactive PDFs. One can make slideshows with Asymptote, it lacks only the OCG layers.
On the OCG layers see : https://acrobatusers.com/tutorials/print/creating-and-using-layers-ocgs-with-acrobat-javascript
One example with LaTeX : http://www.texample.net/weblog/2008/nov/02/creating-pdf-layers/
More examples with the ocgx package of LaTeX : http://mirrors.ctan.org/macros/latex/contrib/ocgx/demo-ocgx.pdf