Fabiz / PeakFinder-API

Demo Page form embedding the PeakFinder API
MIT License
28 stars 1 forks source link

Question: Make background transparent? #1

Closed salsa-barbecue closed 2 years ago

salsa-barbecue commented 2 years ago

How can I change the background of the mountain projetion to transparent? I can't see it in the options but i need it

Fabiz commented 2 years ago

This is currently not possible. But I think I can add such an option. Out of curiosity: can you describe what you like to do with the transparent background?

salsa-barbecue commented 2 years ago

I need to use my default background color and maybe in the future use the view as a layer on a georeferenced image

silvio-barbotto commented 2 years ago

Any update on the transparent background?

Fabiz commented 2 years ago

I did some experiments with a transparent background. Unfortunately this was not working correctly on some browsers.

So I decided to skip transparency and just added the option to set the background/sky color. See here for the result: https://fabiz.github.io/PeakFinder-API/basicexample_canvas_bgcolor.html

Add the key 'bgcolor' to the init options:

let panel = new PeakFinder.PanoramaPanel({
  locale: 'en',
  bgcolor: '#87CEEB'
}) // attach to canvas

I hope this works for your use case.

Fabiz commented 2 years ago

Added option to set the background color.

silvio-barbotto commented 2 years ago

Thanks for the reply, I tryed to use the #RRGGBBAA hex value for the color but it seems there is still a black layer in background, can you remove it?

Fabiz commented 2 years ago

Please use #RRGGBB instead of #RRGGBBAA. I'll make the color parser more tolerant in a next update.