'Snap to features of Vectortile layer using Openlayers

I want to snap to features in a Mapbox Vector tile (MVT) layer but failed to do so. Is there an example code or way to achieve this? Thank you.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source