I want to create map listener being able to draw polygons snapped to roads. These polygons will be some areas limited by streets. I'm trying to achieve that by using Directions API. When user clicks near to the road, it works fine - point is snapped to the closest point on the road. Of course I'm collecting points contained by path, to create polygon later.
There is a problem with streets' directions. Often when I click some point, the path is created in roundabout way. This occurs when I use any type of TravelMode, even google.maps.TravelMode.WALKING. See the image for details.
Red lines shows what I want to obtain and black lines is the path generated by Directions API.
Is there any way to ignore streets' directions? I mean when I click some point near to road, the point is snapped to center of the road, regardless if it is possible to get there from previously clicked point. Maybe there are some other approaches to select areas by streets?