Callbacks
The optional JavaScript callback functions enables developers to react on events fired by FSI TouchZoom.
Refer to the appropriate chapter to learn how to implement callbacks.
onConfigsReady
onConfigsReady(config)
Called as soon as the configuration is loaded.
instance.addListener('onConfigsReady', (config) => {
// config loaded
myFunc(config)
})
Example
onDestroy
onDestroy()
Called as soon as the viewer is destroyed.
instance.addListener('onDestroy', () => {
// instance is destroyed
doReallyGoodThings()
})
Example
onInit
onInit(parameters)
Called as soon as the viewer is initialized.
instance.addListener('onInit', (parameters) => {
// instance is initialized
myFunc(parameters)
})
Example
onReady
onReady()
Called as soon as the instance is ready.
instance.addListener('onReady', () => {
// instance is ready
doReallyGoodThings()
})
Example
onZoomChanged
onZoomChanged(docScale, pixelRatio)
Called as soon as the zoom scope is changed.
instance.addListener('onZoomChanged', (docScale, pixelRatio) => {
// zoom scope changed
myFunc(docScale, pixelRatio)
})
Example