aboutsummaryrefslogtreecommitdiff
path: root/modern/src/map/switcher
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src/map/switcher')
-rw-r--r--modern/src/map/switcher/switcher.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/modern/src/map/switcher/switcher.js b/modern/src/map/switcher/switcher.js
index 2c89faea..22ff9488 100644
--- a/modern/src/map/switcher/switcher.js
+++ b/modern/src/map/switcher/switcher.js
@@ -1,7 +1,8 @@
export class SwitcherControl {
- constructor(onBeforeSwitch, onAfterSwitch) {
+ constructor(onBeforeSwitch, onSwitch, onAfterSwitch) {
this.onBeforeSwitch = onBeforeSwitch;
+ this.onSwitch = onSwitch;
this.onAfterSwitch = onAfterSwitch;
this.onDocumentClick = this.onDocumentClick.bind(this);
this.styles = [];
@@ -52,6 +53,8 @@ export class SwitcherControl {
diff: false,
});
+ this.onSwitch(target.dataset.id);
+
this.mapStyleContainer.style.display = 'none';
this.styleButton.style.display = 'block';