Skip to content

Commit

Permalink
add subscribers
Browse files Browse the repository at this point in the history
  • Loading branch information
bmatthieu3 committed Oct 30, 2023
1 parent e0c2288 commit e14b269
Show file tree
Hide file tree
Showing 6 changed files with 1,364 additions and 26 deletions.
2 changes: 1 addition & 1 deletion examples/al-gw.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import A from '../src/js/A.js';
let aladin;
A.init.then(() => {
aladin = A.aladin('#aladin-lite-div', {projection: "TAN", target: '15 16 57.636 -60 55 7.49', showCooGrid: true, fov: 90, fullScreen: true});
aladin = A.aladin('#aladin-lite-div', {projection: "TAN", target: '15 16 57.636 -60 55 7.49', samp: true, showCooGrid: true, fov: 90, fullScreen: true});

var moc_0_99 = A.MOCFromURL("./gw/gw_0.9.fits",{ name: "GW 90%", color: "#ff0000", opacity: 0.7, lineWidth: 5, perimeter: true});
var moc_0_95 = A.MOCFromURL("./gw/gw_0.6.fits",{ name: "GW 60%", color: "#00ff00", opacity: 0.8, lineWidth: 5, perimeter: true});
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
},
"dependencies": {
"autocompleter": "^6.1.3",
"jquery": "^3.6.1",
"sampjs": "^1.0.3"
"jquery": "^3.6.1"
}
}
11 changes: 8 additions & 3 deletions src/js/Aladin.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ export let Aladin = (function () {

// Constructor
var Aladin = function (aladinDiv, requestedOptions) {
this.samp = new SAMPConnector(this);


// check that aladinDiv exists, stop immediately otherwise
if ($(aladinDiv).length == 0) {
return;
Expand Down Expand Up @@ -475,6 +472,13 @@ export let Aladin = (function () {
this.contextMenu = new ContextMenu(this);
this.contextMenu.attachTo(this.view.catalogCanvas, DefaultActionsForContextMenu.getDefaultActions(this));
}

if (options.samp) {
this.samp = new SAMPConnector(this);
ALEvent.SAMP_AVAILABILITY.listenedBy(this.aladinDiv, function (e) {
console.log('is hub running samp', e.detail.isHubRunning)
});
}
};

/**** CONSTANTS ****/
Expand Down Expand Up @@ -508,6 +512,7 @@ export let Aladin = (function () {
reticleColor: "rgb(178, 50, 178)",
reticleSize: 22,
log: true,
samp: true,
allowFullZoomout: false,
realFullscreen: false,
showAllskyRing: false,
Expand Down
1 change: 0 additions & 1 deletion src/js/View.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,6 @@ export let View = (function () {
}

this.computeNorder();
this.redraw();
};

var pixelateCanvasContext = function (ctx, pixelateFlag) {
Expand Down
Loading

0 comments on commit e14b269

Please sign in to comment.