fix case where base layer is an ImageFITS. It was entering planet case because isPlanetaryBody is undefined which is !== false

This commit is contained in:
Matthieu BAUMANN
2023-05-05 13:06:42 +02:00
parent c661e03e90
commit 2a617849d2
3 changed files with 10 additions and 1 deletions

View File

@@ -14,7 +14,7 @@ export let GenericPointer = (function (view, e) {
let radec = view.wasm.screenToWorld(xymouse.x, xymouse.y);
if (radec) {
// sky case
if (view.aladin.getBaseImageLayer().properties.isPlanetaryBody === false) {
if (view.aladin.getBaseImageLayer().isPlanetaryBody() === false) {
const queryRadius = Math.min(1, 15 * view.fov / view.largestDim);
console.log('queryRadius "generic pointer": ', queryRadius);
SimbadPointer.query(radec[0], radec[1], queryRadius, view.aladin);

View File

@@ -242,6 +242,11 @@ export let ImageFITS = (function () {
}
};
// FITS images does not mean to be used for storing planetary data
ImageFITS.prototype.isPlanetaryBody = function() {
return false;
}
// @api
ImageFITS.prototype.focusOn = function () {
// ensure the fits have been parsed

View File

@@ -370,6 +370,10 @@ export let ImageSurvey = (function () {
}
}
ImageSurvey.prototype.isPlanetaryBody = function() {
return this.properties.isPlanetaryBody;
}
// @api
// TODO: include imgFormat inside the ImageSurvey's meta attribute
ImageSurvey.prototype.setImageFormat = function (format) {