Skip to content

Commit

Permalink
doc: update
Browse files Browse the repository at this point in the history
  • Loading branch information
mistic100 committed Oct 1, 2023
1 parent a7c9656 commit 5b37955
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
10 changes: 5 additions & 5 deletions docs/guide/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
Photo Sphere Viewer uses a lot of angles for its configuration, most of them can be defined in radians by using a simple number (`3.5`) or in degrees using the "deg" suffix (`'55deg'`).
:::

::: tip Positions definitions
Some methods takes positionnal arguments, this is either on combination `yaw` and `pitch` (radians or degrees) or `textureX` and `textureY` properties (corresponding to the pixel position on the source panorama file).
:::

## Standard options

#### `container` (required)
Expand Down Expand Up @@ -348,7 +344,7 @@ keyboardActions: {

Configure keyboard actions. It is a map defining key code->action. (all the available actions are listed above)

Since 5.0.2 you can configure an arbitrary callback to any key.
You can also configure an arbitrary callback to any key.

```js
keyboardActions: {
Expand All @@ -367,6 +363,10 @@ keyboardActions: {
},
```

::: warning
Keyboard actions will only be available in fullscreen by default, this can be changed with the [`keyboard` option](#keyboard).
:::

#### `rendererParameters`

- type: [`WebGLRendererParameters`](https://threejs.org/docs/#api/en/renderers/WebGLRenderer)
Expand Down
14 changes: 13 additions & 1 deletion docs/guide/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ viewer.addEventListener('ready', () => {

This section describes the most useful methods available.

::: tip Positions definitions
Some methods takes positionnal arguments, this is either on combination `yaw` and `pitch` (radians or degrees) or `textureX` and `textureY` properties, corresponding to the pixel position on the source panorama file.
:::

### `animate(options): Animation`

Rotate and zoom the view with a smooth animation. You can change the position (`yaw`, `pitch` or `textureX`, `textureY`) and the zoom level (`zoom`).
Expand All @@ -49,6 +53,10 @@ viewer.animate({

Remove the viewer from the page and free the memory used by Three.js.

### `getPlugin(pluginId): PluginInstance`

Return the instance of plugin, more details on [the dedicated page](../plugins/README.md).

### `getPosition(): Position`

Return the current position of the view.
Expand Down Expand Up @@ -109,6 +117,10 @@ viewer.setPanorama('image.jpg', {
});
```

### `zoom(level)` | `zoomIn()` | `zoomOut()`
### `setOverlay(overlay[, opacity]): Promise`

Change the current [overlay](./config.md#overlay) without changing the panorama.

### `zoom(level)` | `zoomIn([step = 1])` | `zoomOut([step = 1])`

Change the zoom level without animation.

0 comments on commit 5b37955

Please sign in to comment.