diff options
Diffstat (limited to 'modern/src')
-rw-r--r-- | modern/src/map/switcher/switcher.js | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/modern/src/map/switcher/switcher.js b/modern/src/map/switcher/switcher.js index ee0f41ed..b6c62a6e 100644 --- a/modern/src/map/switcher/switcher.js +++ b/modern/src/map/switcher/switcher.js @@ -15,10 +15,6 @@ export class SwitcherControl { return 'top-right'; } - getStyle(id) { - return this.styles.find((it) => it.id === id); - } - updateStyles(updatedStyles, defaultStyle) { this.styles = updatedStyles; @@ -67,7 +63,7 @@ export class SwitcherControl { onSelectStyle(target) { this.onBeforeSwitch(); - const style = this.getStyle(target.dataset.id); + const style = this.styles.find((it) => it.id === target.dataset.id); this.map.setStyle(style.style, { diff: false }); this.map.setTransformRequest(style.transformRequest); |