Browse Source

Add config parameter to use `minHfov` for `multires` panoramas.

Normally, the value of `minHfov` is ignored for said panoramas, and an
automatically calculated value is used instead.
pull/645/head
Matthew Petroff 6 years ago
parent
commit
35083170d5
2 changed files with 12 additions and 2 deletions
  1. +10
    -1
      doc/json-config-parameters.md
  2. +2
    -1
      src/js/pannellum.js

+ 10
- 1
doc/json-config-parameters.md View File

@@ -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)


+ 2
- 1
src/js/pannellum.js View File

@@ -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) {


Loading…
Cancel
Save