Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

json-config-parameters.md 17 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544
  1. # JSON Configuration File Options
  2. ## General options
  3. ### `type` (string)
  4. This specifies the panorama type. Can be `equirectangular`, `cubemap`, or
  5. `multires`. Defaults to `equirectangular`.
  6. ### `title` (string)
  7. If set, the value is displayed as the panorama's title. If no title is desired,
  8. don't set this parameter.
  9. ### `author` (string)
  10. If set, the value is displayed as the panorama's author. If no author is
  11. desired, don't set this parameter.
  12. ### `authorURL` (string)
  13. If set, the displayed author text is hyperlinked to this URL. If no author URL
  14. is desired, don't set this parameter. The `author` parameter must also be set
  15. for this parameter to have an effect.
  16. ### `strings` (dictionary)
  17. Allows user-facing strings to be changed / translated.
  18. See `defaultConfig.strings` definition in `pannellum.js` for more details.
  19. ### `basePath` (string)
  20. This specifies a base path to load the images from.
  21. ### `autoLoad` (boolean)
  22. When set to `true`, the panorama will automatically load. When `false`, the
  23. user needs to click on the load button to load the panorama. Defaults to
  24. `false`.
  25. ### `autoRotate` (number)
  26. Setting this parameter causes the panorama to automatically rotate when loaded.
  27. The value specifies the rotation speed in degrees per second. Positive is
  28. counter-clockwise, and negative is clockwise.
  29. ### `autoRotateInactivityDelay` (number)
  30. Sets the delay, in milliseconds, to start automatically rotating the panorama
  31. after user activity ceases. This parameter only has an effect if the
  32. `autoRotate` parameter is set. Before starting rotation, the viewer is panned
  33. to the initial pitch.
  34. ### `autoRotateStopDelay` (number)
  35. Sets the delay, in milliseconds, to stop automatically rotating the panorama
  36. after it is loaded. This parameter only has an effect if the `autoRotate`
  37. parameter is set.
  38. ### `orientationOnByDefault` (boolean)
  39. If set to `true`, device orientation control will be used when the panorama is
  40. loaded, if the device supports it. If false, device orientation control needs
  41. to be activated by pressing a button. Defaults to `false`. Note that a secure
  42. HTTPS connection is required for device orientation access in most browsers.
  43. Additionally, this feature does not work in combination with `autoLoad: true`
  44. in most browsers, since a user interaction is required to prompt for permission.
  45. ### `showZoomCtrl` (boolean)
  46. If set to `false`, the zoom controls will not be displayed. Defaults to `true`.
  47. ### `keyboardZoom` (boolean)
  48. If set to `false`, zooming with keyboard will be disabled. Defaults to `true`.
  49. ### `mouseZoom` (boolean or string)
  50. If set to `false`, zooming with mouse wheel will be disabled. Defaults to `true`.
  51. Can also be set to `fullscreenonly`, in which case it is only enabled when the
  52. viewer is fullscreen. Can also be set to `ctrl`, in which case the `ctrl` key
  53. must be held down to zoom with the mouse wheel (except while the viewer is
  54. fullscreen); when the `ctrl` key is required for mouse wheel zooming, the use
  55. of `ctrl` / `shift` for zoom control is disabled.
  56. ### `doubleClickZoom` (boolean)
  57. If set to `false`, the zoom to click location on double click function will be
  58. disabled. Defaults to `true`.
  59. ### `draggable` (boolean)
  60. If set to `false`, mouse and touch dragging is disabled. Defaults to `true`.
  61. ### `dragConfirm` (boolean or string)
  62. If set to `false`, one finger can be used to pan viewer. Defaults to `false`.
  63. Can also be set to `pitch`, `yaw`, or `both`. If set to `pitch` or `both`, two
  64. fingers need to be used to pan vertically (except while the viewer is
  65. fullscreen). If set to `yaw` or `both`, two fingers need to be used to pan
  66. horizontally (except while the viewer is fullscreen).
  67. ### `friction` (number)
  68. Controls the "friction" that slows down the viewer motion after it is dragged
  69. and released. Higher values mean the motion stops faster. Should be set
  70. (0.0, 1.0]; defaults to 0.15.
  71. ### `disableKeyboardCtrl` (boolean)
  72. If set to `true`, keyboard controls are disabled. Defaults to `false`.
  73. ### `showFullscreenCtrl` (boolean)
  74. If set to `false`, the fullscreen control will not be displayed. Defaults to
  75. `true`. The fullscreen button will only be displayed if the browser supports
  76. the fullscreen API.
  77. ### `showControls` (boolean)
  78. If set to `false`, no controls are displayed. Defaults to `true`.
  79. ### `touchPanSpeedCoeffFactor` (number)
  80. Adjusts panning speed from touch inputs. Defaults to `1`.
  81. ### `yaw` (number)
  82. Sets the panorama's starting yaw position in degrees. Defaults to `0`.
  83. ### `pitch` (number)
  84. Sets the panorama's starting pitch position in degrees. Defaults to `0`.
  85. ### `hfov` (number)
  86. Sets the panorama's starting horizontal field of view in degrees. Defaults to
  87. `100`.
  88. ### `minYaw` and `maxYaw` (number)
  89. Sets the minimum / maximum yaw the viewer edge can be at, in degrees.
  90. Defaults to `-180` / `180`, i.e. no limit.
  91. ### `minPitch` and `maxPitch` (number)
  92. Sets the minimum / maximum pitch the viewer edge can be at, in degrees.
  93. Defaults to `undefined`, so the viewer center can reach `-90` / `90`.
  94. ### `minHfov` and `maxHfov` (number)
  95. Sets the minimum / maximum horizontal field of view, in degrees, that the
  96. viewer can be set to. Defaults to `50` / `120`. Unless the `multiResMinHfov`
  97. parameter is set to `true`, the `minHfov` parameter is ignored for
  98. `multires` panoramas.
  99. ### `multiResMinHfov` (boolean)
  100. When set to `false`, the `minHfov` parameter is ignored for `multires`
  101. panoramas; an automatically calculated minimum horizontal field of view is used
  102. instead. Defaults to `false`.
  103. ### `compass` (boolean)
  104. If `true`, a compass is displayed. Normally defaults to `false`; defaults to
  105. `true` if heading information is present in Photo Sphere XMP metadata.
  106. ### `northOffset` (number)
  107. Set the offset, in degrees, of the center of the panorama from North. As this
  108. affects the compass, it only has an effect if `compass` is set to `true`.
  109. ### `preview` (string)
  110. Specifies a URL for a preview image to display before the panorama is loaded.
  111. ### `previewTitle` (string)
  112. Specifies the title to be displayed while the load button is displayed.
  113. ### `previewAuthor` (string)
  114. Specifies the author to be displayed while the load button is displayed.
  115. ### `horizonPitch` and `horizonRoll` (number)
  116. Specifies pitch / roll of image horizon, in degrees (for correcting
  117. non-leveled panoramas).
  118. ### `animationTimingFunction` (function) [API only]
  119. This specifies a timing function to be used for animating movements such as
  120. when the `lookAt` method is called. The default timing function is
  121. `easeInOutQuad`. If a custom function is specified, it should take a number
  122. [0, 1] as its only argument and return a number [0, 1].
  123. ### `escapeHTML` (boolean)
  124. When true, HTML is escaped from configuration strings to help mitigate possible
  125. DOM XSS attacks. This is always `true` when using the standalone viewer since
  126. the configuration is provided via the URL; it defaults to `false` but can be
  127. set to `true` when using the API.
  128. ### `targetBlank` (boolean)
  129. When `true`, `target="_blank"` is set on most hyperlinks to open them in new
  130. tabs. This is always `true` when using the standalone viewer since said viewer
  131. is often used in an `<iframe>`, where it doesn't make sense to open the link in
  132. the same place. Defaults to `false`.
  133. ### `crossOrigin` (string)
  134. This specifies the type of CORS request used and can be set to either
  135. `anonymous` or `use-credentials`. Defaults to `anonymous`.
  136. ### `hotSpots` (object)
  137. This specifies a dictionary of hot spots that can be links to other scenes,
  138. information, or external links. Each array element has the following properties.
  139. #### `pitch` (number)
  140. Specifies the pitch portion of the hot spot's location, in degrees.
  141. #### `yaw` (number)
  142. Specifies the yaw portion of the hot spot's location, in degrees.
  143. #### `type` (string)
  144. Specifies the type of the hot spot. Can be `scene` for scene links or `info`
  145. for information hot spots. A tour configuration file is required for `scene`
  146. hot spots.
  147. #### `text` (string)
  148. This specifies the text that is displayed when the user hovers over the hot
  149. spot.
  150. #### `URL` (string)
  151. If specified for an `info` hot spot, the hot spot links to the specified URL.
  152. Not applicable for `scene` hot spots.
  153. #### `attributes` (dict)
  154. Specifies URL's link attributes. If not set, the `target` attribute is set to
  155. `_blank`, to open link in new tab to avoid opening in viewer frame / page.
  156. #### `sceneId` (string)
  157. Specifies the ID of the scene to link to for `scene` hot spots. Not applicable
  158. for `info` hot spots.
  159. #### `targetPitch` (number)
  160. Specifies the pitch of the target scene, in degrees. Can also be set to `same`,
  161. which uses the current pitch of the current scene as the initial pitch of the
  162. target scene.
  163. #### `targetYaw` (number)
  164. Specifies the yaw of the target scene, in degrees. Can also be set to `same` or
  165. `sameAzimuth`. These settings use the current yaw of the current scene as the
  166. initial yaw of the target scene; `same` uses the current yaw directly, while
  167. `sameAzimuth` takes into account the `northOffset` values of both scenes to
  168. maintain the same direction with regard to north.
  169. #### `targetHfov` (number)
  170. Specifies the HFOV of the target scene, in degrees. Can also be set to `same`,
  171. which uses the current HFOV of the current scene as the initial HFOV of the
  172. target scene.
  173. #### `id` (string)
  174. Specifies hot spot ID, for use with API's `removeHotSpot` function.
  175. #### `cssClass` (string)
  176. If specified, string is used as the CSS class for the hot spot instead of the
  177. default CSS classes.
  178. #### `createTooltipFunc` (function) and `createTooltipArgs` (object)
  179. If `createTooltipFunc` is specified, this function is used to create the hot
  180. spot tooltip DOM instead of the default function. The contents of
  181. `createTooltipArgs` are passed to the function as arguments.
  182. #### `clickHandlerFunc` (function) and `clickHandlerArgs` (object)
  183. If `clickHandlerFunc` is specified, this function is added as an event handler
  184. for the hot spot's `click`, `pointerup`, and `touchend` events. The event object
  185. and the contents of `clickHandlerArgs` are passed to the function as arguments.
  186. #### `draggable`
  187. If specified, the hotspot can moved using the mouse or by touch.
  188. #### `dragHandlerFunc` (function) and `dragHandlerArgs` (object)
  189. If `dragHandlerFunc` is specified, this function is added as an event handler
  190. when dragging of the hotspot starts and ends. The event object and the contents of
  191. `dragHandlerArgs` are passed to the function as arguments. Possible types of the
  192. event object are: `mousedown`, `pointerdown`, `touchend`, `pointerup`, `pointerleave`,
  193. `mouseup`, and `mouseleave`.
  194. #### `scale` (boolean or number)
  195. When `true`, the hot spot is scaled to match changes in the field of view,
  196. relative to the initial field of view. Note that this does not account for
  197. changes in local image scale that occur due to distortions within the viewport.
  198. Defaults to `false`.
  199. #### `scaleFactor` (number)
  200. Applies a fixed scaling to the default hot spot size. Can be combined with `scale`.
  201. ### `hotSpotDebug` (boolean)
  202. When `true`, the mouse pointer's pitch and yaw are logged to the console when
  203. the mouse button is clicked. Defaults to `false`.
  204. ### `sceneFadeDuration` (number)
  205. Specifies the fade duration, in milliseconds, when transitioning between
  206. scenes. Not defined by default. Only applicable for tours. Only works with
  207. WebGL renderer.
  208. ### `capturedKeyNumbers` (array)
  209. Specifies the key numbers that are captured in key events. Defaults to the
  210. standard keys that are used by the viewer.
  211. ### `backgroundColor` ([number, number, number])
  212. Specifies an array containing RGB values [0, 1] that sets the background color
  213. for areas where no image data is available. Defaults to `[0, 0, 0]` (black).
  214. For partial `equirectangular` panoramas this applies to areas past the edges of
  215. the defined rectangle. For `multires` and `cubemap` (including fallback) panoramas
  216. this applies to areas corresponding to missing tiles or faces. If set to `null`,
  217. the background is not cleared.
  218. ### `avoidShowingBackground` (boolean)
  219. If set to `true`, prevent displaying out-of-range areas of a partial panorama
  220. by constraining the yaw and the field-of-view. Even at the corners and edges
  221. of the canvas only areas actually belonging to the image
  222. (i.e., within [`minYaw`, `maxYaw`] and [`minPitch`, `maxPitch`]) are shown,
  223. thus setting the `backgroundColor` option is not needed if this option is set.
  224. Defaults to `false`. The `minPitch` and `maxPitch` parameters must be defined
  225. if this option is enabled.
  226. ## `equirectangular` specific options
  227. ### `panorama` (string or HTMLImageElement or ImageData or ImageBitmap)
  228. If a string is passed, it sets the URL to the equirectangular panorama image.
  229. This is relative to `basePath` if it is set, else it is relative to the location of
  230. `pannellum.htm`. An absolute URL can also be used.
  231. Alternatively, an already loaded image can be passed.
  232. ### `haov` (number)
  233. Sets the panorama's horizontal angle of view, in degrees. Defaults to `360`.
  234. This is used if the equirectangular image does not cover a full 360 degrees in
  235. the horizontal.
  236. ### `vaov` (number)
  237. Sets the panorama's vertical angle of view, in degrees. Defaults to `180`. This
  238. is used if the equirectangular image does not cover a full 180 degrees in the
  239. vertical.
  240. ### `vOffset` (number)
  241. Sets the vertical offset of the center of the equirectangular image from the
  242. horizon, in degrees. Defaults to `0`. This is used if `vaov` is less than `180`
  243. and the equirectangular image is not cropped symmetrically.
  244. ### `ignoreGPanoXMP` (boolean)
  245. If set to `true`, any embedded Photo Sphere XMP data will be ignored; else,
  246. said data will override any existing settings. Defaults to `false`.
  247. ## `cubemap` specific options
  248. ### `cubeMap`
  249. This is an array of URLs for the six cube faces in the order front, right,
  250. back, left, up, down. These are relative to `basePath` if it is set, else they
  251. are relative to the location of `pannellum.htm`. Absolute URLs can also be
  252. used. Partial cubemap images may be specified by giving `null` instead of a URL.
  253. ## `multires` specific options
  254. ### `multiRes`
  255. This contains information about the multiresolution panorama in sub-keys.
  256. #### `basePath` (string)
  257. This is the base path of the URLs for the multiresolution tiles. It is relative
  258. to the regular `basePath` option if it is defined, else it is relative to the
  259. location of `pannellum.htm`. An absolute URL can also be used.
  260. #### `path` (string)
  261. This is a format string for the location of the multiresolution tiles, relative
  262. to `multiRes.basePath`, which is relative to `basePath`. Format parameters are
  263. `%l` for the zoom level, `%s` for the cube face, `%x` for the x index, and
  264. `%y` for the y index. For each tile, `.extension` is appended.
  265. #### `fallbackPath` (string)
  266. This is a format string for the location of the fallback tiles for the CSS 3D
  267. transform-based renderer if the WebGL renderer is not supported, relative
  268. to `multiRes.basePath`, which is relative to `basePath`. The only format
  269. parameter is `%s`, for the cube face. For each face, `.extension` is appended.
  270. #### `extension` (string)
  271. Specifies the tiles' file extension. Do not include the `.`.
  272. #### `tileResolution` (number)
  273. This specifies the size in pixels of each image tile.
  274. #### `maxLevel` (number)
  275. This specifies the maximum zoom level.
  276. #### `cubeResolution` (number)
  277. This specifies the size in pixels of the full resolution cube faces the image
  278. tiles were created from.
  279. #### `shtHash` (string)
  280. Specifies the spherical-harmonic-transform-based preview hash. This is rendered
  281. instead of the background color before the base set of cube faces are loaded.
  282. #### `equirectangularThumbnail` (string or HTMLImageElement or ImageData or ImageBitmap)
  283. Specifies a equirectangular preview thumbnail to be rendered instead of the
  284. background color or SHT hash before the base set of cube faces are loaded. This
  285. image can either be specified as a Base64-encoded string or as an object that
  286. can be directly uploaded to a WebGL texture, e.g., `ImageData`, `ImageBitmap`,
  287. `HTMLImageElement`, `HTMLCanvasElement` objects. If a Base64-encoded string is
  288. used, the image size should be kept small, since it needs to be loaded with the
  289. configuration parameters.
  290. #### `missingTiles` (string)
  291. This specifies tiles that are missing and should not be loaded. A compact
  292. encoding is used for these data.
  293. ## Dynamic content specific options
  294. Currently, only equirectangular dynamic content is supported.
  295. ### `dynamic` (boolean)
  296. The panorama source is considered dynamic when this is set to `true`. Defaults
  297. to `false`. This should be set to `true` for video.
  298. ### `dynamicUpdate` (boolean)
  299. For dynamic content, viewer will start automatically updating when set to
  300. `true`. Defaults to `false`. If the updates are controlled via the `setUpdate`
  301. method, as with the Video.js plugin, this should be set to `false`.
  302. ## Additional information for tour configuration files
  303. A tour configuration file contains two top level properties, `default` and
  304. `scenes`. The `default` property contains options that are used for each scene,
  305. but options specified for individual scenes override these options. The
  306. `default` property is required to have a `firstScene` property that contains
  307. the scene ID for the first scene to be displayed. The `scenes` property
  308. contains a dictionary of scenes, specified by scene IDs. The values assigned to
  309. these IDs are specific to each scene.