Google Maps. Tracking history on the map. Incorrect route because of errors in the coordinates

Viewed 1251

My app shows the tracking history of the vehicle on Google Map. We receive the location from our mobile app every 2 mins and store it do DB. After that we show the route (using JS API, Directions Service) on the map.

{
  origin: 'Chicago, IL',
  destination: 'Los Angeles, CA',
  waypoints: [
    ...
     ],
  provideRouteAlternatives: false,
  travelMode: 'DRIVING',
  unitSystem: google.maps.UnitSystem.IMPERIAL
}

However, sometimes location can be inaccurate for only 3-5 meters. As an example some location can be shown on the line of oncoming trafic. As a result, Google creates the route around couple blocks etc. enter image description here

So the question: is there any possible way to ignore such inaccurate points and just "force" Google to create the route in one direction?

Thanks!

1 Answers
Related