aboutsummaryrefslogtreecommitdiff
path: root/modern/src/map/switcher/switcher.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-05-01 11:36:15 -0700
committerAnton Tananaev <anton@traccar.org>2022-05-01 11:36:15 -0700
commit90f292b7739835202842d88eeaf55a531d29d3c3 (patch)
treefd55ee9bb5b67cfe03d5873aea86d5697367f121 /modern/src/map/switcher/switcher.js
parentf2bd440c7fdf8857a5704f214d96aba3345a14e7 (diff)
downloadtrackermap-web-90f292b7739835202842d88eeaf55a531d29d3c3.tar.gz
trackermap-web-90f292b7739835202842d88eeaf55a531d29d3c3.tar.bz2
trackermap-web-90f292b7739835202842d88eeaf55a531d29d3c3.zip
Persist map layer
Diffstat (limited to 'modern/src/map/switcher/switcher.js')
-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';