visual stimming

My nephew has recently been diagnosed with autism and he visually stims. This would not be an issue normally however, he does it when taking him out in the community which turns the whole experience in something very stressful and draining.

His visual stim consists of looking out of the corner of his eyes while he appears to follow lines while walking. he generally listens and pays attention if you show him something but he may refuse to change directions as he wants to follow on a particular path. We take him to safe places such as the park but this is not not always possible as he likes walking and refuses the buggy wherever we go. He is only 22 months.

He seems to do this at home not to often only when tired, feeling unwell or bored as he likes interacting with others.

I would welcome any advice as to how best to manage this or find a way to provide the same stimulation without the risk. 

Thank you