Connector

The Modest Maps connector lets you configure a layer from MapBox with Modest Maps easily.

Example

var mm = com.modestmaps;

wax.tilejson('https://api.tiles.mapbox.com/v3/mapbox.world-bright.jsonp',
    function(tilejson) {
    var m = new mm.Map('map-div',
      new wax.mm.connector(tilejson));
    m.setCenterZoom(new mm.Location(39, -98), 2);
});

Note that this layer will have its outerLimits set - so it will not try to load tiles that are not rendered - but it will not restrict zooming of the map as of Modest Maps 1.0.0.

To restrict zooming of the map, you can call setZoomRange on the map object:

m.setZoomRange(tilejson.minzoom, tilejson.maxzoom);

API

var layer = wax.mm.connector(tilejson)

Returns a new layer usable by Modest Maps.