I've been following a tutorial on creating route animations using Mapbox, which you can find here.
Although I have followed all the steps in the tutorial, my animation isn't as smooth as I'd like it to be. The issue seems to be with the camera movements.
If you visit the link and scroll down a bit, you'll come across a section titled 'SMOOTHING THINGS OUT WITH LERP'. It explains the use of the lerp function with two demonstration videos showcasing its impact. As I'm a bit confused about implementing this function, my camera movements are quite sharp.
Currently, I have an array of coordinates for drawing the polyline. However, when I use these coordinates directly, the camera movements become jarring. To solve this, I believe passing these coordinates through the lerp function will provide new positions for the camera resulting in smoother transitions.
// Code snippets related to targetRoute, computation functions, and camera positioning...
// Missing code snippet due to confusion regarding lerp implementation
I am seeking guidance on how to incorporate the lerp function into my animation for smoother camera movements. Can anyone help me out?