feat: add possibility of loading a local hips without the need of starting an http server

This commit is contained in:
Matthieu Baumann
2024-09-18 14:52:18 +02:00
parent bf726088ad
commit 504cab42bb
17 changed files with 343 additions and 99 deletions

View File

@@ -580,7 +580,8 @@ export class OverlayStackBox extends Box {
// Center the view around the new fits object
self.aladin.gotoRaDec(ra, dec);
self.aladin.setFoV(fov * 1.1);
//self.aladin.selectLayer(image.layer);
URL.revokeObjectURL(url);
}
);
@@ -590,6 +591,31 @@ export class OverlayStackBox extends Box {
);
},
}),
ContextMenu.webkitDir({
label: "Load local HiPS",
action(files) {
let id = files[0].webkitRelativePath.split("/")[0];
let name = id;
let hips = self.aladin.createImageSurvey(
id,
name,
files,
null,
null,
{
errorCallback: (e) => {
aladin.addStatusBarMessage({
duration: 2000,
type: 'info',
message: 'Could not add the local HiPS',
})
}
}
)
self.aladin.addNewImageLayer(hips);
},
}),
],
tooltip: {
content: "Add a HiPS or an FITS image",