Fabiz / PeakFinder-API

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

add Listeners when azimut/altitude/viewPoint change #14

Open lhapaipai opened 4 months ago

lhapaipai commented 4 months ago

Hi @Fabiz, Thanks for this great API. It's awesome !! I wonder if it be posible to define listeners in order to define callback functions when the azimut/altitude/viewpoint is changed.

panel.addListener("viewpoint_changed", (e) => {
  // do some logic.
});
panel.addListener("azimut_changed", (e) => {
  // do some logic.
});

in fact I would like to integrate PeakFinder into a map application. It is currently only possible to synchronize the map with PeakFinder in one direction. you can define a specific state into PeakFinder but you cannot update an application following user interaction on PeakFinder.

thank you for your response and have a nice day !!

woheller69 commented 2 months ago

what about this?

PeakFinder~registerCommandsCallback(command) Registers a callback that receives commands/messages from the PanoramaPanel. The PanoramaPanel will send a message when a specific event occured. E.g. when a new viewpoint was loaded the command: viewpoint changed lat=46.53722&lng=8.12610