Skip to content

Commit

Permalink
🎨 Improve Aladin Lite layer naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Xen0Xys committed Jul 15, 2024
1 parent c402555 commit 88751b9
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions js/models/message_handler.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { convertOptionNamesToCamelCase } from "../utils";
import A from "../aladin_lite";

let imageCount = 0;

export default class MessageHandler {
constructor(aladin) {
this.aladin = aladin;
Expand All @@ -20,17 +22,12 @@ export default class MessageHandler {
const decoder = new TextDecoder("utf-8");
const blob = new Blob([decoder.decode(buffer)]);
const url = URL.createObjectURL(blob);
// TODO: Change the name of the overlay to something more meaningful
const image = this.aladin.createImageFITS(
url,
"temp",
options,
(ra, dec) => {
console.info(`FITS located at ra: ${ra}, dec: ${dec}`);
URL.revokeObjectURL(url);
},
);
this.aladin.setOverlayImageLayer(image, "temp");
const image = this.aladin.createImageFITS(url, options, (ra, dec) => {
this.aladin.gotoRaDec(ra, dec);
console.info(`FITS located at ra: ${ra}, dec: ${dec}`);
URL.revokeObjectURL(url);
});
this.aladin.setOverlayImageLayer(image, `image_${++imageCount}`);
}

handleAddCatalogFromURL(msg) {
Expand Down

0 comments on commit 88751b9

Please sign in to comment.