Easing is moving from one point or zoom to another in a fluid motion, instead of just 'popping' from place to place. It's useful for map-based storytelling, since users get a better idea of geographical distance.
Returns an easey object, which has the following methods:
Specify the map to be used.
Arguments:
map
is an instance ofmapbox.map()
orMM.Map
Returns the easey object.
Set the starting coordinate for the easing. You don't usually need to call this, because easings default to the current coordinate.
Arguments:
coord
is an instance ofMM.Coordinate
representing the starting coordinate for the easing.
Returns the easey object.
Set the destination coordinate for the easing.
Arguments:
coord
is an instance ofMM.Coordinate
representing the destination coordinate for the easing.
Since easey deals exclusively in Coordinates, the reference for converting between points, locations, and coordinates in Modest Maps is essential reading.
Returns the easey object.
Set the zoom level of the to
coordinate that easey is easing to.
Arguments:
level
is a number representing the zoom level
Returns the easey object.
Eases to from
in the smoothest way possible, automatically choosing run time based on distance. The easing zooms out and in to optimize for the shortest easing time and the slowest percieved speed. The optional arguments are as defined in Smooth and efficient zooming and panning.
Arguments:
V
inversely affects the speed (default is 0.9)rho
affects the sensitivity of zooming in and out (default 1.42)callback
is a function that gets called after the animation completes.
Returns the easey object.
Sets the to
coordinate to the provided location.
Arguments:
location
is an object withlat
andlon
properties, or an instance ofMM.Location
.
Returns the easey object.
Set the map to a specific point in the easing.
Arguments:
value
is a float between 0 and 1, where 0 isfrom
and 1 isto
.
Returns the easey object.
Get the future of an easing transition, given a number of parts for it to be divided over. This is a convenience function for calling easey.t()
a bunch of times.
Arguments:
parts
is an positive integer representing the number of parts to divide the easing into.
Returns an array of MM.Coordinate
objects representing each in-between location.
Set the easing curve - this defines how quickly the transition gets to its end and whether it speeds up or slows down near the beginning and end.
Arguments:
name
is the string name of the easing to use. Current options are:- 'easeIn'
- 'easeOut'
- 'easeInOut'
- 'linear'
Returns the easey object.
Set the type of path - the type of interpolation between points.
Arguments:
pathname
is a string name of the path to use. Current options are:screen
: a 'straight line' path from place to place - in the Mercator projection, this is a rhumb lineabout
: the default path for a double-click zoom: this keeps a single coordinate in the same screen pixel over the zoom transition
Returns the easey object.
Start an animated ease. Both parameters are optional.
Arguments:
time
is an integer representing the duration of the easing in milliseconds (default is 1000).callback
is a Javascript function that is called when the map has reached its destination.
Returns the easey object.
Returns true
or false
depending on whether easey is currently animating the map.
Abort the currently running animation.
Arguments:
callback
is a function to be called after the previous animation has been successfully stopped.
Returns the easey object.