Back to Tools and Commands

Zoom

The zoom command handles the zoom of the primary camera in the scene. To activate this command, call:

api.commands.activateCommand('zoom')

options

The default options for zoom are:

options: {
  slider: null,
}

slider

The slider option will initialize a range slider to control the zoom. It can be activated with the following code:

// minZoom must be no more than 1 with a default value of 0.1
// maxZoom must be no less than 1 with a default value of 10
api.commands.setCommandOptions('zoom', { slider: { minZoom: 0.5, maxZoom: 5 } });

Please note that if you enable the slider, you will no longer able to zoom with mouse scroll or pinch on touchable device.