I've written a small algorithm that animates markers' movement from
one point to another. The algorithm looks like this in pseudocode:

lat_delta = new_lat - old_lat;
lng_delta = new_lng - old_lng;

for(alpha=0; alpha < 1; alpha += 0.1) {
   lat = old_lat + (alpha * lat_delta);
   lng = old_lng + (alpha * lng_delta);
   update_marker(lat, lng);
}

The full code is available at http://dev.syskall.com/map/ and
http://dev.syskall.com/map/commute.js.

The problem I have run into is that when the map is zoomed out, the
animation seems to "zig zag". That being said, when you zoom in, the
animation is _much_ smoother.

I thought maybe it was due to the fact that my animation is based on
lat,lng coordinates and when you zoom out, Google Maps is not as
precise and must round the position somehow. Is there any way around
this problem? How should I accomplish what I'm trying to do? The
current implementation is just fine when the map is zoomed in but not
so good when it's zoomed out. Any suggestions? Any better way to do
this?

Thanks,
Oli

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to