360 HD Viewer API
The following section describes the functions, properties and their behaviors in the 360 HD Viewer API.
- Functions
- Events
- Properties
The Cylindo framework
When embedding the 360 HD Viewer javascript widget onto your page the Cylindo framework will install the required modules into the “window.cylindo” namespace (hence it depends on no other global variable by the name “cylindo” is defined as it will break the Cylindo framework). Once the framework has been installed it is safe to use the modules installed. You can use the on ready event be sure the framework is installed and ready to use.
if (cylindo) {
cylindo.on("ready", function () {
console.log("cylindo framework ready!");
});
}
Instantiation
You can instantiate a 360 HD Viewer instance once the cylindo framework has been installed onto the page. You should do this by deferring instantiation until the cylindo frame reports that it is ready. This can be done in the following way.
var viewerInstance = null;
var options {
'accountID': 4965,
'productCode': 'EMMA_ARMCHAIR',
'features': ['UPHOLSTERY', 'YELLOW', 'LEGS', 'METAL_LEGS'],
'containerID': 'cylindoViewerWrapper'
}
if (cylindo) {
cylindo.on('ready', function () {
viewerInstance = cylindo.viewer.create(options);
});
}
The cylindo.viewer.create function takes a configuration object with the minimum required properties explained below.
Minimum required properties
- accountID:
- The account ID that will be given to client by Cylindo (demo customer ID is 4404).
- Type: integer
- productCode
- The furniture base sku for which the 360 HD Viewer is intended to display imagery.
- Type: string
- containerID:
- The ID of the HTML element the 360 HD Viewer will be embedded into.
- Type: string