mirror of
https://github.com/cds-astro/aladin-lite.git
synced 2025-12-12 23:49:32 -08:00
UI: expose gamma slider. Fix #190
This commit is contained in:
committed by
Matthieu Baumann
parent
5562d74c0b
commit
a6f2f1ed76
@@ -25,9 +25,9 @@
|
|||||||
|
|
||||||
aladin.setImageLayer(survey2);
|
aladin.setImageLayer(survey2);
|
||||||
|
|
||||||
/*setTimeout(() => {
|
setTimeout(() => {
|
||||||
aladin.removeHiPSFromFavorites(survey3)
|
aladin.removeHiPSFromFavorites(survey3)
|
||||||
}, 10000);*/
|
}, 5000);
|
||||||
|
|
||||||
|
|
||||||
aladin.addColormap('mycmap', ["lightblue", "red", "violet", "lightgreen"])
|
aladin.addColormap('mycmap', ["lightblue", "red", "violet", "lightgreen"])
|
||||||
|
|||||||
@@ -326,6 +326,7 @@ impl Layers {
|
|||||||
.ok_or(err_layer_not_found)?;
|
.ok_or(err_layer_not_found)?;
|
||||||
self.layers.remove(id_layer);
|
self.layers.remove(id_layer);
|
||||||
|
|
||||||
|
al_core::log(&format!("remove layer {:?}", id_layer));
|
||||||
// Loop over all the meta for its longitude reversed property
|
// Loop over all the meta for its longitude reversed property
|
||||||
// and set the camera to it if there is at least one
|
// and set the camera to it if there is at least one
|
||||||
let longitude_reversed = self.meta.values().any(|meta| meta.longitude_reversed);
|
let longitude_reversed = self.meta.values().any(|meta| meta.longitude_reversed);
|
||||||
@@ -335,9 +336,13 @@ impl Layers {
|
|||||||
// Check if the url is still used
|
// Check if the url is still used
|
||||||
let id_still_used = self.ids.values().any(|rem_id| rem_id == &id);
|
let id_still_used = self.ids.values().any(|rem_id| rem_id == &id);
|
||||||
if id_still_used {
|
if id_still_used {
|
||||||
|
al_core::log("still used");
|
||||||
|
|
||||||
// Keep the resource whether it is a HiPS or a FITS
|
// Keep the resource whether it is a HiPS or a FITS
|
||||||
Ok(id_layer)
|
Ok(id_layer)
|
||||||
} else {
|
} else {
|
||||||
|
al_core::log("not needed");
|
||||||
|
|
||||||
// Resource not needed anymore
|
// Resource not needed anymore
|
||||||
if let Some(hips) = self.hipses.remove(&id) {
|
if let Some(hips) = self.hipses.remove(&id) {
|
||||||
// A HiPS has been found and removed
|
// A HiPS has been found and removed
|
||||||
|
|||||||
@@ -424,12 +424,11 @@ export let Aladin = (function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// at least id or url is defined
|
// at least id or url is defined
|
||||||
let key = id || url;
|
let key = name || id || url;
|
||||||
|
|
||||||
// Merge what is already in the cache for that HiPS with new properties
|
// Merge what is already in the cache for that HiPS with new properties
|
||||||
// coming from the MOCServer
|
// coming from the MOCServer
|
||||||
let hips = new HiPS(key, key, cachedSurvey)
|
self.hipsCache.append(key, cachedSurvey);
|
||||||
self.hipsCache.append(key, hips);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
this._setupUI(options);
|
this._setupUI(options);
|
||||||
@@ -1443,9 +1442,11 @@ export let Aladin = (function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Aladin.prototype.removeUIByName = function(name) {
|
Aladin.prototype.removeUIByName = function(name) {
|
||||||
let elt = this.ui.find((elm) => elm.name === name)
|
let index = this.ui.findIndex((elm) => elm.name === name)
|
||||||
if (elt) {
|
if (index >= 0) {
|
||||||
elt.remove()
|
this.ui[index].remove();
|
||||||
|
|
||||||
|
this.ui.splice(index, 1);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1540,11 +1541,12 @@ export let Aladin = (function () {
|
|||||||
maxOrder,
|
maxOrder,
|
||||||
options
|
options
|
||||||
) {
|
) {
|
||||||
let hips = new HiPS(id, url || id, { name, maxOrder, url, cooFrame, ...options })
|
let hipsOptions = { id, name, maxOrder, url, cooFrame, ...options };
|
||||||
|
let hips = new HiPS(id, url || id, hipsOptions)
|
||||||
|
|
||||||
if (this instanceof Aladin && !this.hipsCache.contains(id)) {
|
if (this instanceof Aladin && !this.hipsCache.contains(hips.name)) {
|
||||||
// Add it to the cache as soon as possible if we have a reference to the aladin object
|
// Add it to the cache as soon as possible if we have a reference to the aladin object
|
||||||
this.hipsCache.append(hips.id, hips)
|
this.hipsCache.append(hips.name, hipsOptions)
|
||||||
}
|
}
|
||||||
|
|
||||||
return hips;
|
return hips;
|
||||||
@@ -1591,11 +1593,14 @@ export let Aladin = (function () {
|
|||||||
console.warn(survey + ' is among the list of HiPS currently in the view.');
|
console.warn(survey + ' is among the list of HiPS currently in the view.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let id;
|
||||||
if (typeof survey !== "string") {
|
if (typeof survey !== "string") {
|
||||||
survey = survey.id;
|
id = survey.name
|
||||||
|
} else {
|
||||||
|
id = survey
|
||||||
}
|
}
|
||||||
|
|
||||||
this.hipsCache.delete(survey);
|
this.hipsCache.delete(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1847,9 +1852,9 @@ export let Aladin = (function () {
|
|||||||
const idOrUrl = urlOrHiPSOrFITS;
|
const idOrUrl = urlOrHiPSOrFITS;
|
||||||
// many cases here
|
// many cases here
|
||||||
// 1/ It has been already added to the cache
|
// 1/ It has been already added to the cache
|
||||||
let cachedLayer = hipsCache.get(idOrUrl)
|
let cachedOptions = hipsCache.get(idOrUrl)
|
||||||
if (cachedLayer) {
|
if (cachedOptions) {
|
||||||
imageLayer = cachedLayer
|
imageLayer = A.HiPS(idOrUrl, cachedOptions);
|
||||||
} else {
|
} else {
|
||||||
// 2/ Not in the cache, then we create the hips from this url/id and
|
// 2/ Not in the cache, then we create the hips from this url/id and
|
||||||
// go to the case 3
|
// go to the case 3
|
||||||
@@ -1860,18 +1865,20 @@ export let Aladin = (function () {
|
|||||||
// 3/ It is an image survey.
|
// 3/ It is an image survey.
|
||||||
imageLayer = urlOrHiPSOrFITS;
|
imageLayer = urlOrHiPSOrFITS;
|
||||||
|
|
||||||
let cachedLayer = hipsCache.get(imageLayer.id)
|
let cachedLayerOptions = hipsCache.get(imageLayer.name)
|
||||||
if (!cachedLayer) {
|
|
||||||
hipsCache.append(imageLayer.id, imageLayer)
|
if (!cachedLayerOptions) {
|
||||||
|
hipsCache.append(imageLayer.name, imageLayer.options)
|
||||||
} else {
|
} else {
|
||||||
// first set the options of the cached layer to the one of the user
|
// first set the options of the cached layer to the one of the user
|
||||||
cachedLayer.setOptions(imageLayer.options)
|
|
||||||
// if it is in the cache we get it from the cache
|
// if it is in the cache we get it from the cache
|
||||||
imageLayer = cachedLayer
|
imageLayer = A.HiPS(imageLayer.id, cachedLayerOptions)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
let imageLayerCopied = Object.assign(Object.create(Object.getPrototypeOf(imageLayer)), imageLayer)
|
||||||
|
imageLayerCopied.layer = layer;
|
||||||
|
|
||||||
return this.view.setOverlayImageLayer(imageLayer, layer);
|
return this.view.setOverlayImageLayer(imageLayerCopied, layer);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ export let HiPSList = (function () {
|
|||||||
{
|
{
|
||||||
creatorDid: "ivo://CDS/P/allWISE/color",
|
creatorDid: "ivo://CDS/P/allWISE/color",
|
||||||
id: "P/allWISE/color",
|
id: "P/allWISE/color",
|
||||||
name: "AllWISE color",
|
name: "AllWISE color Red (W4) , Green (W2) , Blue (W1) from raw Atlas Images",
|
||||||
maxOrder: 8,
|
maxOrder: 8,
|
||||||
tileSize: 512,
|
tileSize: 512,
|
||||||
imgFormat: "jpeg",
|
imgFormat: "jpeg",
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ export let HiPS = (function () {
|
|||||||
this.id = id;
|
this.id = id;
|
||||||
|
|
||||||
this.options = options;
|
this.options = options;
|
||||||
this.name = (options && options.name) || undefined;
|
this.name = (options && options.name) || id;
|
||||||
this.startUrl = options.startUrl;
|
this.startUrl = options.startUrl;
|
||||||
|
|
||||||
this.slice = 0;
|
this.slice = 0;
|
||||||
@@ -949,8 +949,8 @@ export let HiPS = (function () {
|
|||||||
let self = this;
|
let self = this;
|
||||||
let hipsCache = this.view.aladin.hipsCache;
|
let hipsCache = this.view.aladin.hipsCache;
|
||||||
|
|
||||||
if (hipsCache.contains(self.id)) {
|
if (hipsCache.contains(self.name)) {
|
||||||
hipsCache.append(self.id, this)
|
hipsCache.append(self.name, this.options)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ export let HiPSCache = (function () {
|
|||||||
/*
|
/*
|
||||||
* key can be a CDS ID or an url. TODO could be an options.name too.
|
* key can be a CDS ID or an url. TODO could be an options.name too.
|
||||||
*/
|
*/
|
||||||
HiPSCache.prototype.append = function (key, image) {
|
HiPSCache.prototype.append = function (key, options) {
|
||||||
this.cache[key] = image;
|
this.cache[key] = options;
|
||||||
|
|
||||||
ALEvent.HIPS_CACHE_UPDATED.dispatchedTo(document.body);
|
ALEvent.HIPS_CACHE_UPDATED.dispatchedTo(document.body);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1830,6 +1830,7 @@ export let View = (function () {
|
|||||||
View.prototype.removeImageLayer = function (layer) {
|
View.prototype.removeImageLayer = function (layer) {
|
||||||
// Get the survey to remove to dissociate it from the view
|
// Get the survey to remove to dissociate it from the view
|
||||||
let imageLayer = this.imageLayers.get(layer);
|
let imageLayer = this.imageLayers.get(layer);
|
||||||
|
|
||||||
if (imageLayer === undefined) {
|
if (imageLayer === undefined) {
|
||||||
// there is nothing to remove
|
// there is nothing to remove
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -63,26 +63,31 @@ export class HiPSBrowserBox extends Box {
|
|||||||
self._filterHiPSList({})
|
self._filterHiPSList({})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const _parseHiPS = (e) => {
|
const _parseHiPS = (e) => {
|
||||||
const value = e.target.value;
|
const value = e.target.value;
|
||||||
|
|
||||||
let image;
|
let image, name;
|
||||||
// A user can put an url
|
// A user can put an url
|
||||||
try {
|
try {
|
||||||
image = new URL(value).href;
|
image = new URL(value).href;
|
||||||
|
name = image;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Or he can select a HiPS from the list given
|
// Or he can select a HiPS from the list given
|
||||||
const hips = HiPSBrowserBox.HiPSList[value];
|
const hips = HiPSBrowserBox.HiPSList[value];
|
||||||
if (hips) {
|
if (hips) {
|
||||||
image = hips.ID || hips.hips_service_url;
|
image = hips.ID || hips.hips_service_url;
|
||||||
|
name = hips.obs_title || hips.ID;
|
||||||
} else {
|
} else {
|
||||||
// Finally if not found, interpret the input text value as the HiPS (e.g. ID)
|
// Finally if not found, interpret the input text value as the HiPS (e.g. ID)
|
||||||
image = value;
|
image = value;
|
||||||
|
name = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (image) {
|
if (image) {
|
||||||
self._addHiPS(image)
|
self._addHiPS(image, name)
|
||||||
self.searchDropdown.update({title: value});
|
self.searchDropdown.update({title: value});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -116,6 +121,11 @@ export class HiPSBrowserBox extends Box {
|
|||||||
searchDropdown.removeClass('aladin-valid')
|
searchDropdown.removeClass('aladin-valid')
|
||||||
searchDropdown.removeClass('aladin-not-valid')
|
searchDropdown.removeClass('aladin-not-valid')
|
||||||
},
|
},
|
||||||
|
change(e) {
|
||||||
|
e.stopPropagation();
|
||||||
|
e.preventDefault()
|
||||||
|
_parseHiPS(e)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -273,10 +283,11 @@ export class HiPSBrowserBox extends Box {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
_addHiPS(id) {
|
_addHiPS(id, name) {
|
||||||
console.log("add hips", id)
|
|
||||||
let self = this;
|
let self = this;
|
||||||
|
|
||||||
let hips = A.imageHiPS(id, {
|
let hips = A.imageHiPS(id, {
|
||||||
|
name,
|
||||||
successCallback: (hips) => {
|
successCallback: (hips) => {
|
||||||
self.searchDropdown.removeClass('aladin-not-valid');
|
self.searchDropdown.removeClass('aladin-not-valid');
|
||||||
self.searchDropdown.addClass('aladin-valid');
|
self.searchDropdown.addClass('aladin-valid');
|
||||||
@@ -288,6 +299,8 @@ export class HiPSBrowserBox extends Box {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
self.aladin.removeUIByName("cube_displayer" + hips.layer)
|
||||||
|
|
||||||
if (!hips.cubeDepth)
|
if (!hips.cubeDepth)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -324,7 +337,7 @@ export class HiPSBrowserBox extends Box {
|
|||||||
|
|
||||||
let slicer = Input.slider({
|
let slicer = Input.slider({
|
||||||
label: "Slice",
|
label: "Slice",
|
||||||
name: "cube slicer",
|
name: "cube_slicer" + hips.layer,
|
||||||
ticks: [idxSlice],
|
ticks: [idxSlice],
|
||||||
tooltip: {content: (idxSlice + 1) + '/' + numSlices, position: {direction: 'bottom'}},
|
tooltip: {content: (idxSlice + 1) + '/' + numSlices, position: {direction: 'bottom'}},
|
||||||
min: 0,
|
min: 0,
|
||||||
@@ -370,7 +383,7 @@ export class HiPSBrowserBox extends Box {
|
|||||||
|
|
||||||
let cubeDisplayer = A.box({
|
let cubeDisplayer = A.box({
|
||||||
close: true,
|
close: true,
|
||||||
name: 'player' + hips.name,
|
name: "cube_displayer" + hips.layer,
|
||||||
header: {
|
header: {
|
||||||
title: 'Player for: ' + hips.name,
|
title: 'Player for: ' + hips.name,
|
||||||
draggable: true,
|
draggable: true,
|
||||||
@@ -378,6 +391,7 @@ export class HiPSBrowserBox extends Box {
|
|||||||
content: Layout.horizontal([prevBtn, nextBtn, slicer, toStr(idxSlice + 1, true) + '/' + toStr(numSlices, false)]),
|
content: Layout.horizontal([prevBtn, nextBtn, slicer, toStr(idxSlice + 1, true) + '/' + toStr(numSlices, false)]),
|
||||||
position: {anchor: 'center top'},
|
position: {anchor: 'center top'},
|
||||||
});
|
});
|
||||||
|
|
||||||
self.aladin.addUI(cubeDisplayer)
|
self.aladin.addUI(cubeDisplayer)
|
||||||
},
|
},
|
||||||
errorCallback: (e) => {
|
errorCallback: (e) => {
|
||||||
|
|||||||
@@ -28,7 +28,6 @@
|
|||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
import { Form } from "../Widgets/Form.js";
|
import { Form } from "../Widgets/Form.js";
|
||||||
import { ColorCfg } from "../../ColorCfg.js";
|
|
||||||
import { Box } from "../Widgets/Box.js";
|
import { Box } from "../Widgets/Box.js";
|
||||||
import { ALEvent } from "../../events/ALEvent.js";
|
import { ALEvent } from "../../events/ALEvent.js";
|
||||||
import opacityIconUrl from '../../../../assets/icons/opacity.svg';
|
import opacityIconUrl from '../../../../assets/icons/opacity.svg';
|
||||||
@@ -165,6 +164,21 @@ import { ColorCfg } from "../../ColorCfg.js";
|
|||||||
slider.update({value: contrast, tooltip: {content: `${contrast.toFixed(3)}`, position: {direction: 'right'}}})
|
slider.update({value: contrast, tooltip: {content: `${contrast.toFixed(3)}`, position: {direction: 'right'}}})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: 'gamma:',
|
||||||
|
tooltip: {content: 'gamma', position: {direction: 'right'}},
|
||||||
|
name: 'gamma',
|
||||||
|
type: 'range',
|
||||||
|
min: 0.1,
|
||||||
|
max: 10.0,
|
||||||
|
ticks: [1.0],
|
||||||
|
value: 1.0,
|
||||||
|
change: (e, slider) => {
|
||||||
|
const gamma = +e.target.value
|
||||||
|
self.options.layer.setGamma(gamma)
|
||||||
|
slider.update({value: gamma, tooltip: {content: `${gamma.toFixed(3)}`, position: {direction: 'right'}}})
|
||||||
|
}
|
||||||
|
},
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
let pixelSettingsContent = new Form({
|
let pixelSettingsContent = new Form({
|
||||||
@@ -274,6 +288,7 @@ import { ColorCfg } from "../../ColorCfg.js";
|
|||||||
this.opacitySettingsContent.set('opacity', hips.getOpacity());
|
this.opacitySettingsContent.set('opacity', hips.getOpacity());
|
||||||
this.luminositySettingsContent.set('brightness', colorCfg.getBrightness());
|
this.luminositySettingsContent.set('brightness', colorCfg.getBrightness());
|
||||||
this.luminositySettingsContent.set('contrast', colorCfg.getContrast());
|
this.luminositySettingsContent.set('contrast', colorCfg.getContrast());
|
||||||
|
this.luminositySettingsContent.set('gamma', colorCfg.getGamma());
|
||||||
this.luminositySettingsContent.set('saturation', colorCfg.getSaturation());
|
this.luminositySettingsContent.set('saturation', colorCfg.getSaturation());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -305,6 +320,7 @@ import { ColorCfg } from "../../ColorCfg.js";
|
|||||||
this.opacitySettingsContent.set('opacity', hips.getOpacity());
|
this.opacitySettingsContent.set('opacity', hips.getOpacity());
|
||||||
this.luminositySettingsContent.set('brightness', colorCfg.getBrightness());
|
this.luminositySettingsContent.set('brightness', colorCfg.getBrightness());
|
||||||
this.luminositySettingsContent.set('contrast', colorCfg.getContrast());
|
this.luminositySettingsContent.set('contrast', colorCfg.getContrast());
|
||||||
|
this.luminositySettingsContent.set('gamma', colorCfg.getGamma());
|
||||||
this.luminositySettingsContent.set('saturation', colorCfg.getSaturation());
|
this.luminositySettingsContent.set('saturation', colorCfg.getSaturation());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -721,11 +721,14 @@ export class OverlayStackBox extends Box {
|
|||||||
self.cachedHiPS = {};
|
self.cachedHiPS = {};
|
||||||
|
|
||||||
for (var key in hipsCache.cache) {
|
for (var key in hipsCache.cache) {
|
||||||
let HiPS = hipsCache.cache[key];
|
let HiPSOptions = hipsCache.cache[key];
|
||||||
|
|
||||||
if (HiPS.name) {
|
/*if (HiPSOptions.name) {
|
||||||
self.cachedHiPS[HiPS.name.toString()] = HiPS;
|
self.cachedHiPS[HiPSOptions.name.toString()] = HiPSOptions;
|
||||||
}
|
} else {
|
||||||
|
self.cachedHiPS[key] = HiPSOptions;
|
||||||
|
}*/
|
||||||
|
self.cachedHiPS[key] = HiPSOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the options of the selector
|
// Update the options of the selector
|
||||||
@@ -739,7 +742,10 @@ export class OverlayStackBox extends Box {
|
|||||||
let currentHiPS = hips.HiPSSelector.options.value
|
let currentHiPS = hips.HiPSSelector.options.value
|
||||||
|
|
||||||
let favoritesCopy = [...favorites];
|
let favoritesCopy = [...favorites];
|
||||||
if (!(currentHiPS in favoritesCopy)) {
|
|
||||||
|
// add the current hips to the selector as well, even if it has been manually
|
||||||
|
// removed from the HiPSList
|
||||||
|
if (favoritesCopy.indexOf(currentHiPS) < 0) {
|
||||||
favoritesCopy.push(currentHiPS)
|
favoritesCopy.push(currentHiPS)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -935,25 +941,25 @@ export class OverlayStackBox extends Box {
|
|||||||
hipsOptions.sort()
|
hipsOptions.sort()
|
||||||
|
|
||||||
for (const layer of layers) {
|
for (const layer of layers) {
|
||||||
|
|
||||||
let HiPSSelector = Input.select({
|
let HiPSSelector = Input.select({
|
||||||
value: layer.name,
|
value: layer.name || layer.id,
|
||||||
options: hipsOptions,
|
options: hipsOptions,
|
||||||
title: layer.name,
|
title: layer.name,
|
||||||
change: (e) => {
|
change: (e) => {
|
||||||
let name = e.target.value;
|
let name = e.target.value;
|
||||||
// search for the
|
// search for the
|
||||||
let HiPS = self.cachedHiPS[name];
|
let HiPSOptions = self.cachedHiPS[name];
|
||||||
|
|
||||||
let image;
|
/*let image;
|
||||||
if (HiPS instanceof Image) {
|
if (HiPS instanceof Image) {
|
||||||
image = HiPS;
|
image = HiPS;
|
||||||
} else {
|
} else {
|
||||||
// HiPS
|
// HiPS
|
||||||
image = HiPS.id || HiPS.url || undefined;
|
image = HiPS.id || HiPS.url || undefined;
|
||||||
}
|
}*/
|
||||||
|
let hips = A.HiPS(HiPSOptions.id || HiPSOptions.url, HiPSOptions);
|
||||||
|
|
||||||
self.aladin.setOverlayImageLayer(image, layer.layer);
|
self.aladin.setOverlayImageLayer(hips, layer.layer);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -963,9 +969,10 @@ export class OverlayStackBox extends Box {
|
|||||||
disable: layer.layer === "base",
|
disable: layer.layer === "base",
|
||||||
tooltip: { content: "Remove", position: { direction: "top" } },
|
tooltip: { content: "Remove", position: { direction: "top" } },
|
||||||
action(e) {
|
action(e) {
|
||||||
|
console.log(layer)
|
||||||
self.aladin.removeImageLayer(layer.layer);
|
self.aladin.removeImageLayer(layer.layer);
|
||||||
// remove HiPS cube player if any
|
// remove HiPS cube player if any
|
||||||
self.aladin.removeUIByName("player" + layer.name)
|
self.aladin.removeUIByName("cube_displayer" + layer.layer)
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1000,11 +1007,9 @@ export class OverlayStackBox extends Box {
|
|||||||
});
|
});
|
||||||
|
|
||||||
let settingsBox = new HiPSSettingsBox(self.aladin);
|
let settingsBox = new HiPSSettingsBox(self.aladin);
|
||||||
|
|
||||||
settingsBox.update({ layer });
|
settingsBox.update({ layer });
|
||||||
settingsBox._hide();
|
settingsBox._hide();
|
||||||
|
|
||||||
|
|
||||||
let settingsBtn = new TogglerActionButton({
|
let settingsBtn = new TogglerActionButton({
|
||||||
icon: { url: settingsIconUrl, monochrome: true },
|
icon: { url: settingsIconUrl, monochrome: true },
|
||||||
size: "small",
|
size: "small",
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ export class DOMElement {
|
|||||||
if (target && target.children) {
|
if (target && target.children) {
|
||||||
index = Array.prototype.indexOf.call(target.children, el);
|
index = Array.prototype.indexOf.call(target.children, el);
|
||||||
}
|
}
|
||||||
|
console.log("remove", el)
|
||||||
el.remove()
|
el.remove()
|
||||||
|
|
||||||
return {target, position: index};
|
return {target, position: index};
|
||||||
|
|||||||
Reference in New Issue
Block a user