dependencies/tilebelt.js
function getParent(tile) {
    // top left
    if (tile[0] % 2 === 0 && tile[1] % 2 === 0) {
        return [tile[0] / 2, tile[1] / 2, tile[2] - 1];
    }
    // bottom left
    if ((tile[0] % 2 === 0) && (!tile[1] % 2 === 0)) {
        return [tile[0] / 2, (tile[1] - 1) / 2, tile[2] - 1];
    }
    // top right
    if ((!tile[0] % 2 === 0) && (tile[1] % 2 === 0)) {
        return [(tile[0] - 1) / 2, (tile[1]) / 2, tile[2] - 1];
    }
    // bottom right
    return [(tile[0] - 1) / 2, (tile[1] - 1) / 2, tile[2] - 1];
}
function getParent(tile) {
    // top left
    if (tile[0] % 2 === 0 && tile[1] % 2 === 0) {
        return [tile[0] / 2, tile[1] / 2, tile[2] - 1];
    }
    // bottom left
    if ((tile[0] % 2 === 0) && (!tile[1] % 2 === 0)) {
        return [tile[0] / 2, (tile[1] - 1) / 2, tile[2] - 1];
    }
    // top right
    if ((!tile[0] % 2 === 0) && (tile[1] % 2 === 0)) {
        return [(tile[0] - 1) / 2, (tile[1]) / 2, tile[2] - 1];
    }
    // bottom right
    return [(tile[0] - 1) / 2, (tile[1] - 1) / 2, tile[2] - 1];
}
function getParent ( tile ) { // top left if ( tile [ 0 ] % 2 === 0 && tile [ 1 ] % 2 === 0 ) { return [ tile [ 0 ] / 2 , tile [ 1 ] / 2 , tile [ 2 ] - 1 ] ; } // bottom left if ( ( tile [ 0 ] % 2 === 0 ) && ( ! tile [ 1 ] % 2 === 0 ) ) { return [ tile [ 0 ] / 2 , ( tile [ 1 ] - 1 ) / 2 , tile [ 2 ] - 1 ] ; } // top right if ( ( ! tile [ 0 ] % 2 === 0 ) && ( tile [ 1 ] % 2 === 0 ) ) { return [ ( tile [ 0 ] - 1 ) / 2 , ( tile [ 1 ] ) / 2 , tile [ 2 ] - 1 ] ; } // bottom right return [ ( tile [ 0 ] - 1 ) / 2 , ( tile [ 1 ] - 1 ) / 2 , tile [ 2 ] - 1 ] ; }
Get the tile one zoom level lower

@name getParent
@param {Array<number>} tile
@returns {Array<number>} tile
@example
var tile = getParent([5, 10, 10])
//=tile
Get the tile one zoom level lower