I have two points on a google map and I want to move between them using smooth animation. Using the map.panTo () method, I can pan them, but the animation only works if the second point is less than the width / height of the map.
So, the idea I came up with is to break the transition into something like:
var destination = next point
get center
check if the destination is in bounds
if so
panTo it
else
get the midpoint between center and point
if midpoint in bounds pan
else get midpoint etc....
Thus, the journey is divided into minimal steps. The problem is that I cannot figure out how to implement this in code (recursive midpoint check). Any help would be great.
page with this problem is related to http://amishh4cker.com/geocaching.html