cds-astro / aladin-lite

An astronomical HiPS visualizer in the browser
https://aladin.cds.unistra.fr/AladinLite/
GNU General Public License v3.0
102 stars 41 forks source link

catalog user `onClick` not working when creating catalog from HiPS #179

Closed alexgoff closed 2 months ago

alexgoff commented 3 months ago

Hello, I am having an issue trying to create my own custom popup for sources clicked in a catalog generated from HiPS. What I expect is that if I set the onClick option to a custom function, the default table and popup should not show. Instead, I do not see my onClick callback called when a source is clicked.

I can create this in the API example for adding a catalog from HiPS

var aladin;
A.init.then(() => {
    aladin = A.aladin('#aladin-lite-div', {target: 'LMC', fov: 55});
    var hips = A.catalogHiPS('https://axel.u-strasbg.fr/HiPSCatService/Simbad', {onClick: () => {console.log('do nothing')}, name: 'Simbad'});
    aladin.addCatalog(hips);
});

What I expect is that no popup or table should show after clicking on a source, and my message should be logged to the console. Instead I see the popup and no message.

Am I understanding this feature incorrectly, or is this a bug? Thank you

bmatthieu3 commented 3 months ago

Hi @alexgoff,

Thanks for the report and to know you are using aladin lite for your viewer. This is indeed a bug. I did a fix in the commit 2b8d06f but as I will take some holidays, a next aladin lite later version will be deployed at my return during the beginning of september.

alexgoff commented 3 months ago

Merci beaucoup, Matthieu! Avez-vous une bonne vacance!

bmatthieu3 commented 2 months ago

This is now fixed in the codebase. A new bugfix release is coming in the very next days