API Reference
new Campzimmer(options) → {Object}
Campzimmer module
Parameters:
Name | Type | Description |
---|---|---|
options | CampzimmerOptions | Options to initilize the module with |
Returns:
Campzimmer instance
- Type
- Object
Methods
updateImage(image) → Promise<void>
Updates the current image loaded into the viewer.
Parameters:
Name | Type | Description |
---|---|---|
image | string | Url of new image |
Returns:
Promise<void>
- Type
- Promise
getSize() → {Object}
Returns the size of the viewer's container
Parameters:
Name | Type | Description |
---|
Returns:
Object
- Type
- Size
setSize(size) → <void>
Set the size of the viewer's container and reconfigures the field of view.
Parameters:
Name | Type | Description |
---|---|---|
size | Size | Size of the container |
Returns:
Void
- Type
- <void>
CampzimmerOptions
Options to configure campzimmer viewer.
Parameters:
Name | Type | Required | Description |
---|---|---|---|
container | string | HTMLElement | Yes | Either the id of the container, or the HTMLElement for which the viewer will fill. |
image | string | No | Image Url. |
caption | string | No | Caption of the image displayed below the image. See example. |
loading_image | string | No | Image Url of the image which will replace the loading text in the center of the loading indicator. |
loading_text | string | No | If a loading image is not set, this loading text will display in the center of the loading indicator. Default 'loading'. |
autorotate | boolean | No | Configures the image to rotate without user interaction. Default |
rotationSpeed | number | No | Configures the speed in which the image rotates. Range 0 to .1. Default 0.04. |
idleTimeout | number(milliseconds) | No | Configures the amount of time between last user interaction and autorotation start again. Default 4000. |
gyroscope | boolean | No | Enables/Disables gyroscope control on mobile devices. Default |
Size
Size option to configure container
Parameters:
Name | Type | Required | Description |
---|---|---|---|
width | string | Yes | Width. Can be described in px, vw, vh, or % units. |
height | string | Yes | Height. Can be described in px, vw, vh, or % units. |