aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modern/src/map/switcher/switcher.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/modern/src/map/switcher/switcher.js b/modern/src/map/switcher/switcher.js
index cb7326f..c239662 100644
--- a/modern/src/map/switcher/switcher.js
+++ b/modern/src/map/switcher/switcher.js
@@ -29,7 +29,9 @@ export class SwitcherControl {
const styleElement = document.createElement('button');
styleElement.type = 'button';
styleElement.innerText = style.title;
- styleElement.classList.add(style.title.replace(/[^a-z0-9-]/gi, '_'));
+ if (style.title) {
+ styleElement.classList.add(style.title.replace(/[^a-z0-9-]/gi, '_'));
+ }
styleElement.dataset.uri = JSON.stringify(style.uri);
styleElement.addEventListener('click', (event) => {
const { srcElement } = event;