'Animate camera along with polyline

I have a set of latitude and longitude . And I have to draw polyline connecting these points and I implemented it . I have added a startcap also to that polyline. And now I need to animate the camera along with that startcap of polyline.

Like moving camera on Google map while we are using navigation. ( Making the startcap at the centre of screen always )



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source