Ver a proveniência

Add API method to get current scene ID.

pull/124/head
Matthew Petroff há 8 anos
ascendente
cometimento
0d286fea43
1 ficheiros alterados com 13 adições e 0 eliminações
  1. +13
    -0
      src/js/pannellum.js

+ 13
- 0
src/js/pannellum.js Ver ficheiro

@@ -181,9 +181,11 @@ container.appendChild(compass);
if (initialConfig.firstScene) {
// Activate first scene if specified in URL
mergeConfig(initialConfig.firstScene);
config.scene = initialConfig.firstScene;
} else if (initialConfig.default && initialConfig.default.firstScene) {
// Activate first scene if specified in file
mergeConfig(initialConfig.default.firstScene);
config.scene = initialConfig.default.firstScene;
} else {
mergeConfig(null);
}
@@ -1604,6 +1606,7 @@ function load() {
function loadScene(sceneId, targetPitch, targetYaw, targetHfov) {
loaded = false;
oldRenderer = renderer;
config.scene = sceneId;
// Set up fade if specified
var fadeImg, workingPitch, workingYaw, workingHfov;
@@ -1869,6 +1872,16 @@ this.loadScene = function(sceneId, pitch, yaw, hfov) {
return this;
}

/**
* Get ID of current scene.
* @memberof Viewer
* @instance
* @returns {string} ID of current scene
*/
this.getScene = function() {
return config.scene;
}

}

return {


Carregando…
Cancelar
Guardar