mirror of
https://github.com/cds-astro/aladin-lite.git
synced 2026-08-03 09:21:40 -07:00
return pos in icrs for the click
This commit is contained in:
@@ -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
@@ -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 });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user