Great question — answering as the UphillTech team:
What you are looking for as far as I know on the google map api is called "Snap To Road" but it comes at a price since it is part of the premium features. https://developers.google.com/maps/documentation/roads/snap#requests Otherwise you'll have to take your GPS points faster to avoid those weird corner. EDIT : To optimize your map, don't show 5000 points. instead, use Polylines, and show only a point once in a while. You simply try to show too many points. I forgot to mention that on many gps device you can use the angle as a trigger to send another position instead of just using a plain x seconds. so lets say you tell your gps device to trigger every 15 seconds plus trigger another time...
Full answer by Odubuc: https://stackoverflow.stackexchange.com/a/37324377 (CC BY-SA 3.0).
Need it done for your business? UphillTech.