mpetroff / pannellum

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

custom hotspot PopUp #1104

Open StadtGE opened 2 years ago

StadtGE commented 2 years ago

Hi,

I want to create an PopUp ( Box with Text), when I click on a hot spot. I don´t know how. I hope sombody can help.

eyecatchup commented 2 years ago

You can simply configure the hot spot like so:

hotSpots: [
  {
    pitch: 0.1628639147350518,
    yaw: -43.752909800132414,
    type: "info",
    clickHandlerFunc: function () {
      confirm('Custom modal') // replace this with code to open your custom pop up
    }
  }
]
StadtGE commented 2 years ago

thank you very much. It works. how can I adjust the pop up? e.g.size etc?

Thank you so much for answers

mpetroff commented 2 years ago

how can I adjust the pop up? e.g.size etc?

You can't using a confirm() (or alert()) modal. You'll have to write your own function to create and style an overlay is you want something custom.