浏览代码

Add API method to get current scene ID.

pull/124/head
Matthew Petroff 8 年前
父节点
当前提交
0d286fea43
共有 1 个文件被更改,包括 13 次插入0 次删除
  1. +13
    -0
      src/js/pannellum.js

+ 13
- 0
src/js/pannellum.js 查看文件

@@ -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 {


正在加载...
取消
保存