mpetroff / pannellum

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

Access current level in multires #1080

Open INF800 opened 2 years ago

INF800 commented 2 years ago

Hi, is there any way to get current level in multires realtime?

for example something like viewer.getCurrentMultiresLevel()

INF800 commented 2 years ago

https://github.com/mpetroff/pannellum/blob/fa11a998a4a0c393933c753d0d7b48243937ca05/src/js/libpannellum.js#L1526

INF800 commented 2 years ago

can we expose level

INF800 commented 2 years ago

I was planning to display using network calls. But it cannot be a best practice.

mpetroff commented 2 years ago

No, there isn't, and I don't see any compelling reason to exposure it. If you have a good reason for it to be exposed, please share it. However, there's a change I'm working on that would use different levels for different parts of the view, to make things more efficient, which would negate the potentially utility of such a value.

You could also figure out the target level (but it may not have loaded yet) by replicating the internal calculation: https://github.com/mpetroff/pannellum/blob/fa11a998a4a0c393933c753d0d7b48243937ca05/src/js/libpannellum.js#L1517-L1523

INF800 commented 2 years ago

The main reason why I need to see the level was to understand the loss/improvement in picture quality. If we cannot grab the current level of our viewer can we do something like viewer.gotoLevel(3) which would take us to that level in current field of view.

mpetroff commented 2 years ago

I'm still not really sure what you're trying to accomplish.