0

I want to display an image while is loading in Panorama in a photoSphereViewer instead of the text that is displayed when the showLoader is true

setPanorama

enter image description here

enter image description here

Y Z
  • 9
  • 2
  • Which package are you using exactly? What do they say in their documentation with regard to the behavior you want to implement? – Octavian Mărculescu Jun 03 '22 at 09:20
  • Next time, you should add the code directly (with copy paste) instead of an image. It's easier this way. – Octavian Mărculescu Jun 03 '22 at 09:23
  • Did you had a look at [this fiddle](https://jsfiddle.net/mistic100/5r684etx/) with the exact loading image config that you need? – Octavian Mărculescu Jun 03 '22 at 09:33
  • @OctavianMărculescu thank you for your reply , i want a loading img when i change from sweep to another sweep so i used the type PanoramaOptions that i founded in a photoSphereViewer and there is a parametere `panoData?: PanoData | PanoDataProvider` that function to compute panorama data once the image is loaded [Search for a PSV.PanoDataProvide] (https://photo-sphere-viewer.js.org/api/psv) , but i didnt know how to pass an image to panoData in a PanoramaOptions – Y Z Jun 03 '22 at 09:43
  • Is it using the same `Viewer` instance? If so, then you should be able to configure the `loadingImg` url like in the fiddle I linked earlier. – Octavian Mărculescu Jun 03 '22 at 09:47
  • @OctavianMărculescu no but i should pass by the ` PanoramaOptions` in the package photoSphereViewer and in the PanoramaOptions there is a `panoData?: PanoData | PanoDataProvider` with too types and for this case i want to use `type PanoDataProvider = (image: HTMLImageElement) => PanoData;` but i didnt know how to pass an image to panoData – Y Z Jun 03 '22 at 10:33
  • @OctavianMărculescu i updated the post , look at it maybe you will understand more – Y Z Jun 03 '22 at 10:37
  • You still need to create a `Viewer` in order to call the `.setPanorama` method on it. That takes an options parameter on the constructor where you can specify the URI of the image using the `loadingImg` property. In other words, don't try to set the image on the `PanoData` or `PanoDataProvider` because there won't be any property that allows you to do it there. You can only decide if you want to show the loader or not (using the `showLoader` property). – Octavian Mărculescu Jun 03 '22 at 11:42
  • Have a look at [this fiddle](https://jsfiddle.net/h2omdeyu/). I left some comments there which I hope can clarify things a bit. – Octavian Mărculescu Jun 03 '22 at 11:50
  • Please avoid posting screenshots, instead post the actual code – Haris Bouchlis Jun 03 '22 at 13:53
  • @OctavianMărculescu thanks a lot , it helped me too much , but know I have a little problem that not all the photos that displayed . – Y Z Jun 03 '22 at 14:20

0 Answers0