Browse Source

Add API functions to get and set north offset (implements #127).

pull/131/head
Matthew Petroff 8 years ago
parent
commit
3a78435b30
1 changed files with 22 additions and 0 deletions
  1. +22
    -0
      src/js/pannellum.js

+ 22
- 0
src/js/pannellum.js View File

@@ -1833,6 +1833,28 @@ this.setHfovBounds = function(bounds) {
};

/**
* Returns the panorama's north offset.
* @memberof Viewer
* @instance
* @returns {number} North offset in degrees
*/
this.getNorthOffset = function() {
return config.northOffset;
};

/**
* Sets the panorama's north offset.
* @memberof Viewer
* @instance
* @param {number} heading - North offset in degrees
* @returns {Viewer} `this`
*/
this.setNorthOffset = function(heading) {
config.northOffset = Math.max(360, Math.min(0, heading));
return this;
};

/**
* Returns the panorama renderer.
* @memberof Viewer
* @instance


Loading…
Cancel
Save