From e6f173f3c04d03e4b0295699ededba46786c7e85 Mon Sep 17 00:00:00 2001 From: MARCHAND MANON Date: Wed, 18 Sep 2024 15:41:45 +0200 Subject: [PATCH] fix: conflict event layerChanged was listened twice --- js/models/event_handler.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/js/models/event_handler.js b/js/models/event_handler.js index 7607712..daead9c 100644 --- a/js/models/event_handler.js +++ b/js/models/event_handler.js @@ -169,6 +169,7 @@ export default class EventHandler { // If the layer is added, update the WCS, FoV, survey and overlay survey if (layerName === "base") { this.updateWCS(); + this.model.set("_survey_body", imageLayer.hipsBody || "sky"); this.model.set("_base_layer_last_view", imageLayer.url); if (pySurveyLock.locked) { pySurveyLock.unlock(); @@ -216,15 +217,6 @@ export default class EventHandler { this.model.save_changes(); }); - this.aladin.on("layerChanged", (imageLayer, layerName, state) => { - if (layerName === "base") - this.model.set("_survey_body", imageLayer.hipsBody || "sky"); - if (layerName !== "base" || state !== "ADDED") return; - this.updateWCS(); - this.model.set("_base_layer_last_view", imageLayer.id); - this.model.save_changes(); - }); - this.aladin.on("resizeChanged", (width, height) => { // Skip resize event when the div is hidden if (width === 1 && height === 1) {