Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

111 lines (60 sloc) 3.188 kB


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.

var ease = mapbox.ease()

Returns an easey object, which has the following methods:


Set the starting coordinate for the easing. You don't usually need to call this, because easings default to the current coordinate.


  • coord is an instance of MM.Coordinate representing the starting coordinate for the easing.

Returns the easey object.

Set the destination coordinate for the easing.


  • coord is an instance of MM.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.


  • level is a number representing the zoom level

Returns the easey object.


Set the map to a specific point in the easing.


  • value is a float between 0 and 1, where 0 is from and 1 is to.

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.


  • 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.


  • 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.


  • 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 line
    • about: 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.[time [, callback])

Start an animated ease. Both parameters are optional.


  • 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.

var isRunning = ease.running()

Returns true or false depending on whether easey is currently animating the map.


Abort the currently running animation.

Returns the easey object.

Jump to Line
Something went wrong with that request. Please try again.