diff --git a/doc/json-config-parameters.md b/doc/json-config-parameters.md index cd6a949..6ed68a7 100644 --- a/doc/json-config-parameters.md +++ b/doc/json-config-parameters.md @@ -151,7 +151,16 @@ Defaults to `undefined`, so the viewer center can reach `-90` / `90`. ### `minHfov` and `maxHfov` (number) Sets the minimum / maximum horizontal field of view, in degrees, that the -viewer can be set to. Defaults to `50` / `120`. +viewer can be set to. Defaults to `50` / `120`. Unless the `multiResMinHfov` +parameter is set to `true`, the `minHfov` parameter is ignored for +`multires` panoramas. + + +### `multiResMinHfov` (boolean) + +When set to `false`, the `minHfov` parameter is ignored for `multires` +panoramas; an automatically calculated minimum horizontal field of view is used +instead. Defaults to `false`. ### `compass` (boolean) diff --git a/src/js/pannellum.js b/src/js/pannellum.js index f542a53..ba9193a 100644 --- a/src/js/pannellum.js +++ b/src/js/pannellum.js @@ -72,6 +72,7 @@ var config, var defaultConfig = { hfov: 100, minHfov: 50, + multiResMinHfov: false, maxHfov: 120, pitch: 0, minPitch: undefined, @@ -2144,7 +2145,7 @@ function zoomOut() { function constrainHfov(hfov) { // Keep field of view within bounds var minHfov = config.minHfov; - if (config.type == 'multires' && renderer) { + if (config.type == 'multires' && renderer && config.multiResMinHfov) { minHfov = Math.min(minHfov, renderer.getCanvas().width / (config.multiRes.cubeResolution / 90 * 0.9)); } if (minHfov > config.maxHfov) {