PolyLine is not on the roads: it goes straight from one point to other
Try to use Google Maps Roads API part Snap to Road which returns the best-fit road geometry for a given set of GPS coordinates. This service takes up to 100 GPS points collected along a route, and returns a similar set of data with the points snapped to the most likely roads the vehicle was … Read more