Sfoglia il codice sorgente

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

pull/131/head
Matthew Petroff 8 anni fa
parent
commit
3a78435b30
1 ha cambiato i file con 22 aggiunte e 0 eliminazioni
  1. +22
    -0
      src/js/pannellum.js

+ 22
- 0
src/js/pannellum.js Vedi 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


Caricamento…
Annulla
Salva