I have a website in which I use javascript and pannellum API to load multiple 360 panoramic views.
Occasionally the browser crashes, particularly when on my iPhone 6 in VR mode when a total of six pannellum instances are required in different DIVs.
As best I can tell, the browser crashes on the call to pannellum which I am doing from inside an eval function as the data I pass to pannellum is contained in a variable.
Here's the call, plus the subsequent line that lets us know that the panorama is loaded.
eval("RightPanoInt=pannellum.viewer('RightPanoIntermediary', " + PanoDataIntermediary +");");
RightPanoInt.on("load", function() { LoadedRightPanoIntermediary(); });
Where
RightPanoInt is a variable I can use to check if the panorama is loaded
RightPanoIntermediary is the id of the DIV the panorama is to be loaded into.
and
PanoDataIntermediary is a variable containing the data / parameters need by the pannellum API.
For example
{"autoLoad": true,"pitch": 0,"yaw": 73,"vaov": 180,"haov": 360,"vOffset": 0,"maxPitch": 90,"minPitch": -90,"maxYaw": 180,"minYaw": -180,"maxHfov": 100,"hfov": 100,"minHfov": 10,"showFullscreenCtrl": false,"orientationOnByDefault": false,"showControls": false,"panorama": "002.jpg","preview":"BackgroundPaleGreen.jpg"}
The data will be different the next time the call is made, so the parameters must be in the PanoDataIntermediary variable.
What alternative method to the eval function can I use to make the same call?