interactions - snap

create snap interaction

        
            this.snap = new ol.interaction.Snap({
                source: vector.getSource(),
                pixelTolerance: 30
            });
        
    

add it to the map

this.map.addInteraction(this.snap);

remove it from the map

this.map.removeInteraction(this.snap);