Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SAMP #128

Merged
merged 2 commits into from
Nov 21, 2023
Merged

SAMP #128

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 0 additions & 2 deletions src/js/A.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,6 @@ A.MOCFromJSON = function (jsonMOC, options) {
};


// TODO: try first without proxy, and then with, if param useProxy not set
// API
A.catalogFromURL = function (url, options, successCallback, errorCallback, useProxy) {
var catalog = A.catalog(options);

Expand Down
9 changes: 9 additions & 0 deletions src/js/Aladin.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import { ALEvent } from "./events/ALEvent.js";
import { Color } from './Color.js';
import { ImageFITS } from "./ImageFITS.js";
import { DefaultActionsForContextMenu } from "./DefaultActionsForContextMenu.js";
import { SAMPConnector } from "./vo/samp.js";
import A from "./A.js";

import $ from 'jquery';
Expand Down Expand Up @@ -471,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 @@ -504,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
2 changes: 2 additions & 0 deletions src/js/events/ALEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ export class ALEvent {

static GRAPHIC_OVERLAY_LAYER_CHANGED = new ALEvent("AL:GraphicOverlayLayer.changed");

static SAMP_AVAILABILITY = new ALEvent("AL:samp.started");

constructor(name) {
this.name = name;
}
Expand Down
Loading