From 492927c557de5a4b347425ba40bfeb8a69733aac Mon Sep 17 00:00:00 2001 From: bmatthieu3 Date: Mon, 17 Mar 2025 11:15:32 +0100 Subject: [PATCH] access HiPS2FITS interface from the contextual menu by giving the WCS object --- examples/al-init-custom-options.html | 1 + src/js/DefaultActionsForContextMenu.js | 21 +++++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/examples/al-init-custom-options.html b/examples/al-init-custom-options.html index 4bfbb5d9..458cc25a 100644 --- a/examples/al-init-custom-options.html +++ b/examples/al-init-custom-options.html @@ -22,6 +22,7 @@ reticleColor: '#ff89ff', // change reticle color reticleSize: 64, // change reticle size showContextMenu: true, + showShareControl: true, showFrame: true, showZoomControl:true, showSettingsControl:true, diff --git a/src/js/DefaultActionsForContextMenu.js b/src/js/DefaultActionsForContextMenu.js index a136bce2..d9a27147 100644 --- a/src/js/DefaultActionsForContextMenu.js +++ b/src/js/DefaultActionsForContextMenu.js @@ -235,10 +235,27 @@ export let DefaultActionsForContextMenu = (function () { }, { label: "HiPS2FITS cutout", action(o) { - let hips2fitsUrl = 'https://alasky.cds.unistra.fr/hips-image-services/hips2fits?'; let hipsId = a.getBaseImageLayer().id; let wcs = JSON.stringify(a.getViewWCS()); - hips2fitsUrl += 'wcs=' + encodeURIComponent(wcs) + '&hips=' + encodeURIComponent(hipsId); + let radec = a.getRaDec(); + let fov = Math.max.apply(null, a.getFov()); + + let hips2fitsUrl = 'https://alasky.cds.unistra.fr/hips-image-services/hips2fits#' + // HiPS identifier + hips2fitsUrl += 'hips=' + encodeURIComponent(hipsId) + + // Parameter given for full support of the Aladin view position and orientation in the sky + // WCS object + + hips2fitsUrl += '&wcs=' + encodeURIComponent(wcs) + // Parameters given to fill the more readable user formular in HiPS2FITS interface + // Sky projection center + hips2fitsUrl += '&ra=' + radec[0] + hips2fitsUrl += '&dec=' + radec[1] + // FoV + hips2fitsUrl += '&fov=' + fov + + // Open HiPS2FITS interface in a new browser tab window.open(hips2fitsUrl, '_blank'); } },