# AutorotatePlugin

NPM version NPM Downloads jsDelivr Hits
API Documentation

Adds an automatic rotation of the panorama, which starts automatically on idle or with a click on a button. The rotation can also be configured to visit specific points.

This plugin is available in the @photo-sphere-viewer/autorotate-plugin (opens new window) package.

# Usage

# Example

# Standard

# Keypoints

# Configuration

# autostartDelay

  • type: integer
  • default: 2000
  • updatable: yes

Delay after which the automatic rotation will begin, in milliseconds.

# autostartOnIdle

  • type: boolean
  • default: true
  • updatable: yes

Restarts the automatic rotation if the user is idle for autostartDelay.

Note: the rotation won't restart of the user explicitly clicks on the navbar button.

# autorotateSpeed

  • type: string
  • default: 2rpm
  • updatable: yes

Speed of the automatic rotation. Can be a negative value to reverse the rotation.

# autorotatePitch

  • type: double | string
  • default: defaultPitch
  • updatable: yes

Vertical angle at which the automatic rotation is performed.

# autorotateZoomLvl

  • type: number
  • default: null
  • updatable: yes

Zoom level at which the automatic rotation is performed. If null the current zoom is kept.

# keypoints

  • type: AutorotateKeypoint[]
  • updatable: no, use setKeypoints() method

Initial keypoints, does the same thing as calling setKeypoints() just after initialisation.

# startFromClosest

  • type: boolean
  • default: true
  • updatable: yes

Start from the closest keypoint instead of the first keypoint of the array.

# lang

  • type: object
  • default:
lang: {
    autorotate: 'Automatic rotation',
}

Note: this option is not part of the plugin but is merged with the main lang object.

# Methods

# setKeypoints(keypoints)

Changes or remove the keypoints.

# start() / stop() / toggle()

As it says.

# Events

# autorotate(autorotateEnabled)

Triggered when the automatic rotation is enabled/disabled.

# Buttons

This plugin adds buttons to the default navbar:

  • autorotate allows to toggle the rotation on and off

If you use a custom navbar you will need to manually add the buttons to the list.