This sample shows how snapping can be enabled: