easey is an easing library for
Modest Maps that
makes your map transitions slick and fancy. You can read
a bit about easey on our blog.
easey has a quick an easy API. try out the examples below. It's also live on the web
in places like this cool GOP map.
Then get it on GitHub
and do cool things with it.
easey.slow(map, new mm.Location(10, 50));
// Go somewhere random in the world. This shows off easey's // main options: // location: a com.modestmaps.Location for a place in the world // easey gets you there, along a great arc. If you provide it // with coordinate: or point: instead (with modestmaps objects), // it'll do non-geographical transforms instead. // zoom: this one writes itself // time: a number of milliseconds for the map movement to take. easey.slow(map, { location: new mm.Location( (Math.random() - 0.5) * 90, (Math.random() - 0.5) * 180), zoom: ~~(Math.random() * 5), time: 2000 });
// Functions take a callback parameter. Here it's pointed // to the function that panned the map in the first place, a, so // this map will keep panning. // The next example will stop the movement. (function a() { easey.slow(map, { point: new mm.Point(600, 300), callback: a, ease: 'linear' }) })();
easey.cancel();
// Instead of calling easey.slow(map, options), you can also call // easey.sequence(map, [options, options, ...]), and it'll cycle // through each, in order. easey.sequence(map, [{ location: new mm.Location(10, 15), ease: 'linear' }, { location: new mm.Location(20, -15), ease: 'linear' }, { location: new mm.Location(30, 15), ease: 'linear', callback: function() { alert('three!'); } }, { location: new mm.Location(40, -15), ease: 'linear' }]);