In a nutshell, you have to keep track of a brief history of drag position
over time so you can calculate the velocity if you want that kind of "flick"
at the end where it keeps going for a short period of time. The way you do
this is when the user starts dragging, you start a periodical that logs the
last 3 or 4 positions of the map every 15 milliseconds or so. When the user
stops dragging, you figure out how far they were away 45 milliseconds ago
and extrapolate their direction and velocity and then use an Fx instance to
transition to where it should end.

I recently coded a MooTools version of this demo for a client:

http://www.apple.com/html5/showcase/threesixty/

But I can't share the code. You can go look at the source of that example
and see how it's done though.



On Thu, Sep 1, 2011 at 5:01 PM, KevinA <[email protected]> wrote:

> Hello,
>
> I have been grinding my map class for a long time now, trying to get a
> drag effect like we see on google maps.
>
> Basically Id like the user to drag and move a map and when they let
> go, the map will keep sliding a bit depending on how fast they dragged
> it (just like Google Maps)
>
> Is this possible just using Mootols or am I going to have to use some
> custom JS alongside the MT drag classes?
>
> Thank you

Reply via email to