I am using the following library: googlemaps/google-maps-services-js
I am generating routes by inserting start/end point, waypoints, mode etc.
I am using the "overviewPolyline" that is returned from calling to directions() call to get the route's polyline.
When viewing the line on a map it shows (in some cases) routes that goes on water\through buildings\road etc. what I need of course is a line that is coherent with the commute method selected (e.g driving).

now, I made a research online, read documentation, read lots of answers here on SO. I saw t2 options:
My results are:
After trying #1 - It fixed some of the cases. but I still see lot of them. (not sure exactly when it happens and when it isn't) I have some idea that I wanted to check that may be the number of points on the polyline is limited and therefore is happens only in long distance routes. but I couldnt find anything about length-limit of polyline in the documentation
After trying #2 - it didn't make sense to me. and it really didnt work well..
Anyone has a suggestion of a solution for that? (or an approval the polyline route distance, or number of points is limited)