From 9a4e9ddb35cddd4328af4313dc76fa84e9ece630 Mon Sep 17 00:00:00 2001 From: Prisacariu Alexandru Date: Fri, 9 Sep 2016 11:47:42 +0300 Subject: [PATCH] Added function to add hotspot to another scene --- src/js/pannellum.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/js/pannellum.js b/src/js/pannellum.js index 5a84ebe..db1396e 100644 --- a/src/js/pannellum.js +++ b/src/js/pannellum.js @@ -2455,6 +2455,23 @@ this.addHotSpot = function(hs) { } /** + * Add a new hot spot to a specific scene. + * @memberof Viewer + * @instance + * @param {string} sceneId - The scene where to add the hot spot + * @param {Object} hs - The configuration for the hot spot + * @returns {boolean} True if the add was successful, else false + */ +this.addHotSpotToScene = function(sceneId, hs) { + // TODO: do some checks if it is the actual scene + if (initialConfig.scenes.hasOwnProperty(sceneId)) { + initialConfig.scenes[sceneId].hotSpots.push(hs); + return true; + } + return false; +} + +/** * Remove a hot spot. * @memberof Viewer * @instance