zoom
Options for the ZoomControl.
If false
is given, it will disable the zoom control.
Name | Type | Default | Description |
---|---|---|---|
scale | number | 1 | Scale factor for rotation |
duration | number | 300 | Duration of the input animation (ms) |
minFov | number | 1 | Minimum vertical fov(field of view).cautionOnly available when type is "fov" |
maxFov | number | "auto" | Maximum vertical fov(field of view).cautionOnly available when type is "fov" If "auto" is given, it will use Math.min(default fov + 45, 175) |
minDistance | number | 0.1 | Minimum camera distance.cautionOnly available when type is "distance" |
maxDistance | number | 2 | Maximum camera distance.cautionOnly available when type is "distance" |
doubleTap | boolean|object | true | Configures double tap to zoom behavior, false to disable |
doubleTap.zoomIn | number | 0.8 | Zoom-in value, relative to fov/distance range.max |
doubleTap.useZoomOut | number | true | Whether to use zoom-out behavior on double tap |
doubleTap.duration | number | 300 | Duration of the zoom-in and zoom-out animation |
doubleTap.easing | function | EASING.EASE_OUT_CUBIC | Zoom-in value, relative to fov/distance range.max |
easing | function | EASING.EASE_OUT_CUBIC | Easing function of the animation |
Example
- JSON
- JavaScript
- React
- Angular
- Vue@2
- Vue@3
- Svelte
{
src: "/egjs-view3d/model/draco/alarm.glb",
poster: "/egjs-view3d/poster/alarm.png",
zoom: true
}
- JSON
- JavaScript
- React
- Angular
- Vue@2
- Vue@3
- Svelte
{
src: "/egjs-view3d/model/draco/alarm.glb",
poster: "/egjs-view3d/poster/alarm.png",
zoom: false
}
Zoom Type
- JSON
- JavaScript
- React
- Angular
- Vue@2
- Vue@3
- Svelte
{
src: "/egjs-view3d/model/draco/alarm.glb",
poster: "/egjs-view3d/poster/alarm.png",
zoom: {
type: "fov"
}
}
- JSON
- JavaScript
- React
- Angular
- Vue@2
- Vue@3
- Svelte
{
src: "/egjs-view3d/model/draco/alarm.glb",
poster: "/egjs-view3d/poster/alarm.png",
zoom: {
type: "distance"
}
}
Double tap to zoom
- JSON
- JavaScript
- React
- Angular
- Vue@2
- Vue@3
- Svelte
{
src: "/egjs-view3d/model/draco/alarm.glb",
poster: "/egjs-view3d/poster/alarm.png",
zoom: {
doubleTap: {
zoomIn: 0.5,
useZoomOut: false,
duration: 100
}
}
}
- JSON
- JavaScript
- React
- Angular
- Vue@2
- Vue@3
- Svelte
{
src: "/egjs-view3d/model/draco/alarm.glb",
poster: "/egjs-view3d/poster/alarm.png",
zoom: {
doubleTap: false
}
}
Detailed Options
- JSON
- JavaScript
- React
- Angular
- Vue@2
- Vue@3
- Svelte
{
src: "/egjs-view3d/model/draco/alarm.glb",
poster: "/egjs-view3d/poster/alarm.png",
zoom: {
scale: 2,
duration: 2000,
minFov: 30,
maxFov: 120
}
}
- JSON
- JavaScript
- React
- Angular
- Vue@2
- Vue@3
- Svelte
{
src: "/egjs-view3d/model/draco/alarm.glb",
poster: "/egjs-view3d/poster/alarm.png",
zoom: {
scale: 2,
duration: 2000,
minFov: 30,
maxFov: 120
}
}