選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

json-config-parameters.md 14 KiB

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