From 2f020219be0eeb7dc46650d297e44e25d66bff74 Mon Sep 17 00:00:00 2001 From: Xen0Xys Date: Tue, 16 Jul 2024 15:14:41 +0200 Subject: [PATCH] :sparkles: Add baseLayerChanged event when the base layer is changed --- src/js/Aladin.js | 1 + src/js/View.js | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/js/Aladin.js b/src/js/Aladin.js index 8dc4812c..69235e17 100644 --- a/src/js/Aladin.js +++ b/src/js/Aladin.js @@ -251,6 +251,7 @@ import { Polyline } from "./shapes/Polyline"; 'cooFrameChanged', 'resizeChanged', 'projectionChanged', + 'layerChanged' */ export let Aladin = (function () { diff --git a/src/js/View.js b/src/js/View.js index 5f33b833..cda4438d 100644 --- a/src/js/View.js +++ b/src/js/View.js @@ -1760,6 +1760,9 @@ export let View = (function () { self.renameLayer(this.overlayLayers[0], "base"); } } + + const layerChangedFn = this.aladin.callbacksByEventName["layerChanged"]; + (typeof layerChangedFn === "function") && layerChangedFn(imageLayer, layer); }) }