This filter allows you to change the travel mode that’s used to calculate the directions. It defaults to driving, but you can change it to bicycling, transit or walking.
This code example shows how to change the travel mode to walking.
This filter is located in /frontend/class-frontend.php
The code needs to be placed in the functions.php file inside your active theme folder.