close panorama

Compass Plugin compass.js HTML5 and iOS 5.0 or higher only
Select Version:

  • The Compass Plugin provides access to the device compass heading information.
  • The device with a compass and iOS 5.0 or higher is necessary to be able to get any compass information.
  • The Compass Plugin can be used together with the Gyro Plugin to adjust the view.hlookat setting at the beginning of the viewing to sync the pano viewing direction to the real world direction.

Syntax

<plugin name="compass" devices="html5"
        url="compass.js"
        onavailable=""
        onchange=""
        />

Plugin Attributes

  • available  (read only)
    • A Boolean value that indicates if the compass information are available on this device.
  • heading  (read only)
    • The compass heading in degree (0.0 - 360.0)

Plugin Events

  • onavailable
    • This event will be called when the compass is available on this device.
  • onchange
    • This event will be called every time when the compass heading has changed.