js/hicBrowser.js
/**
     * Find the closest matching zoom index (index into the dataset resolutions array) for the target resolution.
     *
     * resolutionAraay can be either
     *   (1) an array of bin sizes
     *   (2) an array of objects with index and bin size
     * @param targetResolution
     * @param resolutionArray
     * @returns {number}
     */
Find the closest matching zoom index (index into the dataset resolutions array) for the target resolution.
resolutionAraay can be either
(1) an array of bin sizes
(2) an array of objects with index and bin size
@param targetResolution
@param resolutionArray
@returns {number}
Find the closest matching zoom index ( index into the dataset resolutions array ) for the target resolution . resolutionAraay can be either ( 1 ) an array of bin sizes ( 2 ) an array of objects with index and bin size @param targetResolution @param resolutionArray @returns { number }
findMatchingZoomIndex(targetResolution, resolutionArray) {
        const isObject = resolutionArray.length > 0 && resolutionArray[0].index !== undefined;
        for (let z = resolutionArray.length - 1; z > 0; z--) {
            const binSize = isObject ? resolutionArray[z].binSize : resolutionArray[z];
            const index = isObject ? resolutionArray[z].index : z;
            if (binSize >= targetResolution) {
                return index;
            }
        }
        return 0;
    }
findMatchingZoomIndex ( targetResolution , resolutionArray ) { const isObject = resolutionArray . length > 0 && resolutionArray [ 0 ] . index !== undefined ; for ( let z = resolutionArray . length - 1 ; z > 0 ; z -- ) { const binSize = isObject ? resolutionArray [ z ] . binSize : resolutionArray [ z ] ; const index = isObject ? resolutionArray [ z ] . index : z ; if ( binSize >= targetResolution ) { return index ; } } return 0 ; }
Find the closest matching zoom index (index into the dataset resolutions array) for the target resolution.
Find the closest matching zoom index ( index into the dataset resolutions array ) for the target resolution .