// 404 page using mapbox to show cities around the world.

// Helper to generate the kind of coordinate pairs I'm using to store cities
function bounds() {
  var mapbounds = map.getBounds();
  return [
    [mapbounds._northEast.lat, mapbounds._northEast.lng],
    [mapbounds._southWest.lat, mapbounds._southWest.lng],
    map.getZoom()
  ];
}


L.mapbox.accessToken = "pk.eyJ1IjoiY29udHJvdmVyc2lhbCIsImEiOiJjaXMwaXEwYjUwM2l6MnpwOHdodTh6Y24xIn0.JOD0uX_n_KXqhJ7ERnK0Lg";
var map = L.mapbox.map("map", "mapbox.pencil", {zoomControl: false});

function go(city) {
  var placenames = Object.keys(places);
  city = typeof city === "undefined" ?
    placenames[Math.floor(Math.random() * placenames.length)] :
    city;

  var pos = places[city];
  map.setView(
    [pos.lat, pos.lng],
    pos.zoom
  );
}

go();

@@ -155,25 +155,22 @@
 %7B%0A  var 
-mapbounds
+center
  = map.g
@@ -175,14 +175,14 @@
 .get
-Bounds
+Center
 ();%0A
@@ -194,129 +194,48 @@
 urn 
-%5B%0A    %5Bmapbounds._northEast.lat, mapbounds._northEast.lng%5D,%0A    %5Bmapbounds._southWest.lat, mapbounds._southWest.lng%5D,%0A   
+%7Blat: center.lat, lng: center.lng, zoom:
  map
@@ -248,12 +248,9 @@
 om()
-%0A  %5D
+%7D
 ;%0A%7D%0A

Update bounds() implementation