The package {ocg-p} provides OCG (Optional Content Groups) support within a PDF document, replacing the ocg.sty distributed with asymptote.
The ocg-p package provides the environment that allows to insert OCG
(Optional Content Group) into PDF documents without JavaScript. These
OCGs can be simply described as layers from the user’s point of view.
The ocg-p package is intended as a full replacement for the file ocg.sty
which is part of the asymptote package. While ocg.sty is limited to be used
with pdfLaTeX, the ocg-p package can also be used with XeLaTeX. Additionally nested OCGs (layers inside of another layer) are handled as such.