do not call setView several times on the same imageSurvey

This commit is contained in:
Matthieu Baumann
2024-03-27 10:31:05 +01:00
parent 091effc92c
commit be0c84aa28
5 changed files with 30 additions and 19 deletions

View File

@@ -1,5 +1,9 @@
# Changelogs
## 3.3.2
* [fixed] do not allow to query the properties several times for an imageHiPS
## 3.3.0
* [fixed] multiple calls to setImageSurvey with the same survey object led to strange behaviour.

View File

@@ -25,8 +25,7 @@
aladin.setBaseImageLayer("P/PanSTARRS/DR1/g", {imgFormat: "fits"});
aladin.getBaseImageLayer().setColormap('redtemperature', {stretch: "Asinh"});*/
aladin = A.aladin('#aladin-lite-div', {survey: 'CDS/P/SDSS9/color', fov: 60, target: '0 90', fullScreen: true, cooFrame: 'equatorial', showCooGridControl: true, showSimbadPointerControl: true, showCooGrid: true});
aladin.setProjection('SIN');
aladin = A.aladin('#aladin-lite-div', {survey: 'CDS/P/SDSS9/color', fov: 150, target: '0 90', fullScreen: true, cooFrame: 'equatorial', showCooGridControl: true, showSimbadPointerControl: true, showCooGrid: true});
//let survey = aladin.createImageSurvey("P/PanSTARRS/DR1/g", null, null, null, null, );
/*aladin.setBaseImageLayer("P/PanSTARRS/DR1/g");

View File

@@ -1,34 +1,35 @@
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, height=device-height, maximum-scale=1.0, initial-scale=1.0, user-scalable=no">
</head>
<body>
<div id="aladin-lite-div" style="width: 500px; height: 400px"></div>
<div id="aladin-lite-div" style="width: 500px; height: 500px"></div>
<script type="module">
import A from '../src/js/A.js';
var aladin;
A.init.then(() => {
// Start up Aladin Lite
let aladin = A.aladin('#aladin-lite-div', {target: 'Sgr a*', fov: 0.5, showContextMenu: true});
aladin = A.aladin('#aladin-lite-div', {fullScreen: true, cooFrame: "ICRSd", showSimbadPointerControl: true, showShareControl: true, showShareControl: true, survey: 'https://alasky.cds.unistra.fr/DSS/DSSColor/', fov: 180, showContextMenu: true});
// manage URL parameters
let survey1 = aladin.getBaseImageLayer();
survey1.setColormap('magma', {stretch: 'linear'});
let survey2 = aladin.newImageSurvey("CDS/P/2MASS6X/H");
let survey2 = aladin.newImageSurvey("CSIRO/P/RACS/mid/I");
aladin.setImageLayer(survey2)
survey2.setColormap('rdbu', {stretch: 'asinh'});
let survey3 = aladin.newImageSurvey("https://alasky.cds.unistra.fr/CFHTLS-T0007b/Deep/UALLSKY/");
survey2.setColormap('rdbu', {stretch: 'linear'});
let survey3 = aladin.newImageSurvey("CSIRO/P/RACS/low/I");
aladin.setImageLayer(survey3)
survey3.setColormap('cubehelix', {stretch: 'asinh'});
aladin.setImageLayer(survey3)
aladin.setImageLayer(survey3)
survey3.setColormap('cubehelix', {stretch: 'linear'});
aladin.setImageLayer(survey2);
aladin.setImageLayer(survey3);
aladin.setImageLayer(survey3);
//aladin.setOverlayImageLayer(survey2);
aladin.setImageLayer(survey3)
aladin.setImageLayer(survey2);
});
</script>
</body>
</html>

View File

@@ -2,7 +2,7 @@
"homepage": "https://aladin.u-strasbg.fr/",
"name": "aladin-lite",
"type": "module",
"version": "3.3.1",
"version": "3.3.2",
"description": "An astronomical HiPS visualizer in the browser",
"author": "Thomas Boch and Matthieu Baumann",
"license": "GPL-3",

View File

@@ -174,6 +174,13 @@ export let ImageSurvey = (function () {
ImageSurvey.prototype.setView = function(view) {
let self = this;
// do not allow to call setView multiple times otherwise
// the querying to the properties and the search to the best
// HiPS node will be done again for the same imageHiPS
if (self.view) {
return;
}
self.view = view;
let isMOCServerToBeQueried = true;