Files
aladin-lite/dist/displayJPG.html
Matthieu Baumann c42f0df889 hips layers support
2021-03-04 14:10:24 +01:00

68 lines
2.4 KiB
HTML

<!doctype html>
<html>
<head>
<!-- <link rel="stylesheet" href="../distrib/latest/aladin.min.css" /> -->
<link rel="stylesheet" href="https://aladin.u-strasbg.fr/AladinLite/api/v2/latest/aladin.min.css" />
</head>
<body>
<script src="https://code.jquery.com/jquery-1.10.1.min.js"></script>
Image Opacity: <br/> <input id="slider" type="range" value=1 min=0 max=1 step=0.05 ; style="width:120px;height:5px;line-height:0%">
<br/>
<br/>
<div id="aladin-lite-div" style="width:440px;height:300px"></div>
<input id="DSS" type="radio" name="survey" value="P/DSS2/Color" checked><label for="DSS">Optical (DSS2) <label>
<input id="2MASS" type="radio" name="survey" value="P/2MASS/Color"><label for="2MASS">Infrared (2MASS)<label>
<div id='aladin-statsDiv'></div>
<script type="text/javascript" src="./aladin.js" charset="utf-8"></script>
<script type="text/javascript">
let aladin;
A.init.then(() => {
aladin = A.aladin('#aladin-lite-div', {survey: "P/DSS2/color", target: "0 0", cooFrame: "gal"});
var callback = function(ra, dec, fov) {
aladin.addCatalog(A.catalogFromSimbad( {ra: ra, dec: dec} , 1 , {shape: 'circle', color: '#5d5', onClick: 'showTable'}));
// we must return true, so that the default action (set view to center of image) is performed
return true;
}
aladin.displayJPG(
// the JPG to transform to HiPS
'https://noirlab.edu/public/media/archives/images/large/noirlab1912a.jpg',
// name of the HiPS layer
'overlay',
// no options
null,
// A callback fn once the overlay is set
callback
);
$("#slider").on('input', function() {
aladin.setOpacityLayer($(this).val(), "overlay");
});
(async () => {
let twomass = await A.createImageSurvey("CDS/P/2MASS/color");
let dss2 = await A.createImageSurvey("CDS/P/DSS2/color");
$('input[name=survey]').change(async function() {
let surveyName = $(this).val();
console.log(surveyName)
if (surveyName === "P/2MASS/Color") {
aladin.setBaseImageSurvey(twomass);
} else if (surveyName === "P/DSS2/Color") {
aladin.setBaseImageSurvey(dss2);
}
});
})();
});
</script>
</body>
</html>