jpg by default

This commit is contained in:
bmatthieu3
2022-05-30 15:17:37 +02:00
parent b82abdd15a
commit 85e7d84ffc
2 changed files with 22 additions and 13 deletions

View File

@@ -899,7 +899,6 @@ export let Aladin = (function () {
return radec_j2000;
};
/**
* point to a given position, expressed as a ra,dec coordinate
*

View File

@@ -65,10 +65,19 @@ export async function fetchSurveyProperties(rootURLOrId) {
} else {
if (metadata.length > 1) {
let ids = [];
metadata.forEach((prop) => {
ids.push(prop.ID)
});
throw ids + ' surveys are matching. Please use one from this list.';
let surveyFound = false;
for (let i = 0; i < metadata.length; i++) {
ids.push(metadata[i].ID)
if (metadata[i].ID === id) {
metadata = metadata[i];
surveyFound = true;
break;
}
}
if (!surveyFound) {
throw ids + ' surveys are matching. Please use one from this list.';
}
} else if (metadata.length === 0) {
throw 'no surveys matching';
} else {
@@ -273,16 +282,17 @@ export let HpxImageSurvey = (function() {
// the output format has not been defined by the user
// => we give him one of the available formats
if (!this.imgFormat) {
this.imgFormat = tileFormats[0];
if (this.imgFormat === 'FITS') {
//tileFormat = "FITS";
if (tileFormats.indexOf('PNG') >= 0) {
this.fits = false;
this.imgFormat = "PNG";
} else if (tileFormats.indexOf('JPEG') >= 0) {
this.fits = false;
this.imgFormat = "JPEG";
} else if (tileFormats.indexOf('FITS') >= 0) {
this.fits = true;
} else if (this.imgFormat === "PNG") {
//tileFormat = "PNG";
this.fits = false;
this.imgFormat = "FITS";
} else {
//tileFormat = "JPG";
this.fits = false;
throw "Unsupported format(s) found in the metadata: " + tileFormats;
}
}