mpetroff / pannellum

Pannellum is a lightweight, free, and open source panorama viewer for the web.
https://pannellum.org/
MIT License
4.15k stars 710 forks source link

clearing the cache of the program #1191

Closed zeleamaaa closed 6 months ago

zeleamaaa commented 7 months ago

I have successfully displayed an image using pannellum. when I click "click to load panorama" the image is successfully loaded but the message doesn't disappear so it interferes with displaying the image. I have tried various methods but to no avail. Can you provide a solution to my problem? below I have included the code that I have used. I used React JS in making it and this is the file for my panorama image


import React, { useEffect } from 'react'; import { pannellum } from "./pannellum";

const PanoramaViewer = () => { useEffect(() => { const panoramaContainer = document.getElementById('panorama-container'); pannellum.viewer(panoramaContainer, { type: 'equirectangular', panorama: 'https://pannellum.org/images/alma.jpg', });

return () => {
};

}, []);

return <div id="panorama-container" style={{ width: '100%', height: '500px' }} />; };

export default PanoramaViewer;


Capture

Thank you in advance

LeashFox commented 7 months ago

Hi Zeleamaaa,

Have you tried using the autoLoad: true option in your pannellum.viewer configuration?

This should make the panorama load immediately instead of waiting for the user to click, and should help avoid this message appearing.

Unless, you'd prefer for the user to click to load?

import React, { useEffect } from 'react';
import { pannellum } from "./pannellum";

const PanoramaViewer = () => {
useEffect(() => {
const panoramaContainer = document.getElementById('panorama-container');
pannellum.viewer(panoramaContainer, {
type: 'equirectangular',
panorama: 'https://pannellum.org/images/alma.jpg',

// Add this here.
autoLoad: true,

});

return () => {
};
}, []);

return <div id="panorama-container" style={{ width: '100%', height: '500px' }} />;
};

export default PanoramaViewer;
zeleamaaa commented 7 months ago

Hi Zeleamaaa,

Have you tried using the autoLoad: true option in your pannellum.viewer configuration?

This should make the panorama load immediately instead of waiting for the user to click, and should help avoid this message appearing.

Unless, you'd prefer for the user to click to load?

import React, { useEffect } from 'react';
import { pannellum } from "./pannellum";

const PanoramaViewer = () => {
useEffect(() => {
const panoramaContainer = document.getElementById('panorama-container');
pannellum.viewer(panoramaContainer, {
type: 'equirectangular',
panorama: 'https://pannellum.org/images/alma.jpg',

// Add this here.
autoLoad: true,

});

return () => {
};
}, []);

return <div id="panorama-container" style={{ width: '100%', height: '500px' }} />;
};

export default PanoramaViewer;

Thank you, this is very helpful, I can apply it. I also just realized that some of my configurations were wrong, which caused this problem