Skip to content

Commit

Permalink
✨ Add baseLayerChanged event when the base layer is changed
Browse files Browse the repository at this point in the history
  • Loading branch information
Xen0Xys committed Jul 16, 2024
1 parent b2b7985 commit 2f02021
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/js/Aladin.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ import { Polyline } from "./shapes/Polyline";
'cooFrameChanged',
'resizeChanged',
'projectionChanged',
'layerChanged'
*/

export let Aladin = (function () {
Expand Down
3 changes: 3 additions & 0 deletions src/js/View.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
})
}

Expand Down

0 comments on commit 2f02021

Please sign in to comment.