Viewing an older version of mapbox.js. Check out v1.4.0 for the latest.

Easing links

Add links to ease to various cities.
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Easing links</title>
  <script src='http://api.tiles.mapbox.com/mapbox.js/v0.6.7/mapbox.js'></script>
  <link href='http://api.tiles.mapbox.com/mapbox.js/v0.6.7/mapbox.css' rel='stylesheet' />
  <style>
    body { margin:0; padding:0; }
    #map { position:absolute; top:0; bottom:0; width:100%; }
  </style>
</head>
<body>
<style>
 #map-ui {
    position:absolute;
    top:10px;left:10px;
    z-index:100;
    }
    #map-ui ul {
      list-style:none;
      margin:0;padding:0;
      }
      #map-ui a {
        font-size:13px;
        background:#FFF;
        color:#3C4E5A;
        display:block;
        margin:0;padding:0;
        border:1px solid #BBB;
        border-bottom-width:0;
        min-width:138px;
        padding:10px;
        text-decoration:none;
        }
      #map-ui a:hover { background:#ECF5FA; }
      #map-ui li:last-child a {
        border-bottom-width:1px;
        -webkit-border-radius:0 0 3px 3px;
                border-radius:0 0 3px 3px;
        }
      #map-ui li:first-child a {
        -webkit-border-radius:3px 3px 0 0;
                border-radius:3px 3px 0 0;
        }
</style>

<div id='map-ui'>
  <ul>
    <li><a href='#' id='toronto'>Toronto</a></li>
    <li><a href='#' id='chicago'>Chicago</a></li>
    <li><a href='#' id='dc'>Washington, D.C.</a></li>
  </ul>
</div>
<div id='map'></div>
<script>

  // Create a map
  var map = mapbox.map('map');
  // Create a layer
  var layer = mapbox.layer().id('examples.map-zgrqqx0w');
  // Add the layer
  map.addLayer(layer);
  // Zoom in to level 4
  map.zoom(4);
  // Attribute
  map.ui.attribution.add()
      .content('<a href="http://mapbox.com/about/maps">Terms &amp; Feedback</a>');


  // Run easings when links are clicked

  document.getElementById('toronto').onclick = function() {
    map.ease.location({ lat: 43.6, lon: -79.4 }).zoom(10).optimal();
    return false;
  }

  document.getElementById('chicago').onclick = function() {
    map.ease.location({ lat: 41.9, lon: -87.6 }).zoom(10).optimal();
    return false;
  }

  document.getElementById('dc').onclick = function() {
    map.ease.location({ lat: 38.9, lon: -77 }).zoom(10).optimal();
    return false;
  }

</script>
The code and documentation to mapbox.js is hosted on GitHub where you can contribute changes and improvements.