Home

Awesome

google-panorama-zoom-level

stable

Find the best zoom level for StreetView panoramas based on the specified maximum texture dimension. This is useful to avoid WebGL texture limits on low-end hardware.

Example:

var level = require('google-panorama-zoom-level')

level(4096) // -> 3
level(2048) // -> 2

A typical usage with WebGL capabilities:

var level = require('google-panorama-zoom-level')
var gl = require('webgl-context')()

var maxSize = gl.getParameteri(gl.MAX_TEXTURE_SIZE)
var zoom = level(maxSize)

Usage

NPM

zoom = level(maxSize)

Returns the best zoom level for the given maxSize texture dimension. A stitched StreetView panoramic image at that zoom level will be equal or less than maxSize.

See Also

License

MIT, see LICENSE.md for details.