浏览代码

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 年前
父节点
当前提交
35083170d5
共有 2 个文件被更改,包括 12 次插入2 次删除
  1. +10
    -1
      doc/json-config-parameters.md
  2. +2
    -1
      src/js/pannellum.js

+ 10
- 1
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)


+ 2
- 1
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) {


正在加载...
取消
保存