mirror of
https://github.com/cds-astro/aladin-lite.git
synced 2026-04-28 11:53:18 -07:00
feat: add possibility of loading a local hips without the need of starting an http server
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user