index.js
function bboxToTile(bboxCoords) {
    var min = pointToTile(bboxCoords[0], bboxCoords[1], 32);
    var max = pointToTile(bboxCoords[2], bboxCoords[3], 32);
    var bbox = [min[0], min[1], max[0], max[1]];

    var z = getBboxZoom(bbox);
    if (z === 0) return [0, 0, 0];
    var x = bbox[0] >>> (32 - z);
    var y = bbox[1] >>> (32 - z);
    return [x, y, z];
}
function bboxToTile(bboxCoords) {
    var min = pointToTile(bboxCoords[0], bboxCoords[1], 32);
    var max = pointToTile(bboxCoords[2], bboxCoords[3], 32);
    var bbox = [min[0], min[1], max[0], max[1]];

    var z = getBboxZoom(bbox);
    if (z === 0) return [0, 0, 0];
    var x = bbox[0] >>> (32 - z);
    var y = bbox[1] >>> (32 - z);
    return [x, y, z];
}
function bboxToTile ( bboxCoords ) { var min = pointToTile ( bboxCoords [ 0 ] , bboxCoords [ 1 ] , 32 ) ; var max = pointToTile ( bboxCoords [ 2 ] , bboxCoords [ 3 ] , 32 ) ; var bbox = [ min [ 0 ] , min [ 1 ] , max [ 0 ] , max [ 1 ] ] ; var z = getBboxZoom ( bbox ) ; if ( z === 0 ) return [ 0 , 0 , 0 ] ; var x = bbox [ 0 ] >>> ( 32 - z ) ; var y = bbox [ 1 ] >>> ( 32 - z ) ; return [ x , y , z ] ; }
Get the smallest tile to cover a bbox

@name bboxToTile
@param {Array<number>} bbox
@returns {Array<number>} tile
@example
var tile = bboxToTile([ -178, 84, -177, 85 ])
//=tile
Get the smallest tile to cover a bbox