I have next code for initianing snapHeadingOffset variable based on different conditions:
snapHeadingOffset
var snapHeadingOffset = Float.MaxValue if (prevSnapOption.