return pos in icrs for the click

This commit is contained in:
Matthieu Baumann
2024-07-24 20:57:53 +02:00
parent b9791be5e3
commit 4baab48716
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -17,6 +17,10 @@
var msg;
// define function triggered when a source is hovered
aladin.on('click', function(e) {
console.log(e)
});
aladin.on('objectHovered', function(object, xyMouseCoords) {
if (object) {
msg = 'You hovered object ' + object.data.name + ' located at ' + object.ra + ', ' + object.dec + '; mouse coords - x: '
+1 -1
View File
@@ -901,7 +901,7 @@ export let View = (function () {
// call listener of 'click' event
var onClickFunction = view.aladin.callbacksByEventName['click'];
if (typeof onClickFunction === 'function') {
var pos = view.aladin.pix2world(xymouse.x, xymouse.y);
var pos = view.aladin.pix2world(xymouse.x, xymouse.y, "icrs");
if (pos !== undefined) {
onClickFunction({ ra: pos[0], dec: pos[1], x: xymouse.x, y: xymouse.y, isDragging: wasDragging });
}