You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/plugins/overlays.md
+6-92Lines changed: 6 additions & 92 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,19 +4,15 @@
4
4
5
5
::: module
6
6
<ApiButtonpage="modules/OverlaysPlugin.html"/>
7
-
Display additional images and videos on top of the panorama.
7
+
Display additional images on top of the panorama.
8
8
9
9
This plugin is available in the [@photo-sphere-viewer/overlays-plugin](https://www.npmjs.com/package/@photo-sphere-viewer/overlays-plugin) package.
10
10
:::
11
11
12
12
## Usage
13
13
14
-
Overlays are images and videos "glued" to the panorama. Contrary to [markers](./markers.md) they are part of the 3D scene and not drawn on top of the viewer.
15
-
16
-
Two kinds of overlays are supported :
17
-
18
-
- full size equirectangular/cubemap : will cover the entire panorama
19
-
- positionned rectangle : the image/video has a defined position and size (always in radians/degrees)
14
+
Overlays are images "glued" to the panorama. Contrary to [markers](./markers.md) they are part of the 3D scene and not drawn on top of the viewer.
15
+
The images must have the same proportions of the base panorama and must be transparent. Both equirectangular (full or cropped) and cubemaps are supported.
Overlays seem very similar to image/video markers but serve different purposes:
73
-
74
-
- Markers are for "small" elements, generally interactive
75
-
- Markers are highly configurable (style, tooltip, user events, etc.)
76
-
- Overlays can cover the whole panorama
77
-
- Overlays cannot have a tooltip, change size, etc. You can however listen to click events
78
-
- Overlays are rendered over the panorama itself where markers are rendered flat over the viewer HTML element
79
-
80
-
:::
81
-
82
49
## Configuration
83
50
84
51
#### `overlays`
@@ -107,11 +74,6 @@ Overlays can be a single image/video for a spherical gerometry or six images for
107
74
108
75
Used to remove the overlay with `removeOverlay()` method.
109
76
110
-
#### `type`
111
-
112
-
- type: `image | video`
113
-
- default: `image`
114
-
115
77
#### `opacity`
116
78
117
79
- type: `number`
@@ -128,55 +90,15 @@ Used to remove the overlay with `removeOverlay()` method.
128
90
129
91
- type: `string`
130
92
131
-
Path to the image or video.
132
-
133
-
#### `yaw`, `pitch`, `width`, `height`
134
-
135
-
- type: `number | string`
136
-
137
-
Definition of the position and size of the overlay, if none of the four properties are configured, the overlay will cover the full sphere, respecting the [panorama data](../guide/adapters/equirectangular.md#cropped-panorama) if applicable.
138
-
139
-
#### `chromaKey`
140
-
141
-
- type: `object`
142
-
- default: `{ enabled: false }`
143
-
144
-
Will make a color of the image/video transparent.
145
-
146
-
::: dialog "See details" "Marker chroma key"
147
-
148
-
The `chromaKey` marker option allows to define a color which will be transparent (green screen/blue screen).
149
-
150
-
```ts
151
-
chromaKey: {
152
-
/**
153
-
* Enable the option
154
-
*/
155
-
enabled: true,
156
-
/**
157
-
* Select which color to make transparent (default is green)
158
-
*/
159
-
color: 0x00ff00,
160
-
color: { r: 0, g: 255, 0 },
161
-
/**
162
-
* Customize the color detection (default is 0.2 / 0.2)
163
-
*/
164
-
similarity: 0.2,
165
-
smoothness: 0.2,
166
-
}
167
-
```
168
-
169
-
:::
170
-
171
-
_(This option is only applicable to spherical overlays)._
93
+
Path to the image.
172
94
173
95
#### Cube overlays
174
96
175
97
#### `path` (required)
176
98
177
99
- type: `CubemapPanorama`
178
100
179
-
Check the [cubemap adapter page](../guide/adapters/cubemap.md#panorama-options) for the possible syntaxes. All six faces are required.
101
+
Check the [cubemap adapter page](../guide/adapters/cubemap.md#panorama-options) for the possible syntaxes. All six faces are required but some can be `null`.
180
102
181
103
## Methods
182
104
@@ -192,14 +114,6 @@ Removes an overlay.
192
114
193
115
Removes all overlays.
194
116
195
-
#### `getVideo(id)`
196
-
197
-
Returns the controller of a video overlay (native HTMLVideoElement) in order to change its state, volume, etc.
0 commit comments