Skip to content

Commit

Permalink
Closes #1460 virtual-tour: new "updateNode" method
Browse files Browse the repository at this point in the history
  • Loading branch information
mistic100 committed Oct 21, 2024
1 parent 8fda3c7 commit 93e3c08
Show file tree
Hide file tree
Showing 4 changed files with 226 additions and 115 deletions.
36 changes: 28 additions & 8 deletions docs/plugins/virtual-tour.md
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,22 @@ The default behaviour is to rotate the view to face the direction of the link an

If the [Compass plugin](./compass.md) is enabled, displays the links on the compass.

#### `showLinkTooltip`

- type: `boolean`
- default: `true`
- updatable: no

Should a tooltip be displayed on each link. The default tooltip contains `name` + `thumbnail` + `caption`, it is customizable with the [getLinkTooltip](#getlinktooltipcontent-link-node) option.

#### `getLinkTooltip(content, link, node)`

- type: `function(string, link, node) => string`
- default: `null`
- updatable: no

Callback used to replace/modify the tooltip for a link. The first parameter is the default tooltip content.

#### `map` (client mode only)

Configuration when using the [Map plugin](./map.md).
Expand Down Expand Up @@ -434,14 +450,6 @@ Each node can still have a `map` property to override `color`, `image` and `size

:::::

#### `getLinkTooltip(content, link, node)`

- type: `function(string, link, node) => string`
- default: `null`
- updatable: no

Callback used to replace/modify the tooltip for a link. The first parameter is the default tooltip content which contains the node `name` + `thumbnail` + `caption`.

#### `arrowStyle`

- type: `object`
Expand Down Expand Up @@ -486,6 +494,18 @@ Default value is:

Changes the nodes and display the first one (or the one designated by `startNodeId`).

#### `updateNode(node)` (client mode only)

Updates a single node. If it is the current node, the viewer will be updated accordingly. All attributes or optionnal but `id`.

```js
virtualTourPlugin.updateNode({
id: 'node-1',
caption: 'New caption',
links: [...newLinks],
});
```

#### `setCurrentNode(nodeId, [options])`

Changes the current node. `options` allows to override the default `transitionOptions`.
Expand Down
1 change: 1 addition & 0 deletions examples/plugin-virtual-tour.html
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@
renderMode: '3d',
startNodeId: nodes[1].id,
preload: true,
// showLinkTooltip: false,
transitionOptions: {
// showLoader: false,
// speed: '10rpm',
Expand Down
Loading

0 comments on commit 93e3c08

Please sign in to comment.