pannellum-react icon indicating copy to clipboard operation
pannellum-react copied to clipboard

Potential fix to access denied error

Open mehdi-cit opened this issue 4 years ago • 1 comments

Hello and thank you for this nice library! I had a similar issue as the one discussed in the issue: https://github.com/farminf/pannellum-react/issues/77 The very first time we use the <Pannellum image={some_URL_1} /> with the image source some_URL_1 it works fine. But whenever the I change the image property I pass to that same Pannellum instance exp: <Pannellum image={some_URL_2} />. I get the cannot access problem (all images are hosted on the same site & the problem only appear if I change the url I pass to the image property as I said). The problem disapears if I make a new instance Pannellum instance for every new image URL (But that's wasteful and causes flashing/re-loading ofthe whole panaroma)

I was able to "make it work" without always creating a new Pannellum instance for every new image URL. I had to comment out the line 211 in master/src/elements/Pannellum.js as seen below: if (state === "update") { // this.panorama.destroy(); }

I diagnoally read through the code (quickly, I might have missed something) and it seems the code simply removes canvas from container and the event listeners! I also checked memory consumption and it seems to be just fine

So my question is whether it's really safe to remove that this.panorama.destroy(); call ?

Thank you again!

mehdi-cit avatar Jan 15 '21 17:01 mehdi-cit

@mehdi-cit Did you find a solution? I have the same issue

bekatom avatar Sep 07 '22 17:09 bekatom