aboutsummaryrefslogtreecommitdiff
path: root/modern/src/map
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-09-02 20:49:27 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2021-09-02 20:49:27 -0700
commit10cc10e0e88569cc48d86e9ab4d90538683bfaf6 (patch)
treecb2dbb65a5c914e41f75175316efa6ddcd086997 /modern/src/map
parent8d953869da0b79941987ab1dc6eb00e643ee5d81 (diff)
downloadetbsa-traccar-web-10cc10e0e88569cc48d86e9ab4d90538683bfaf6.tar.gz
etbsa-traccar-web-10cc10e0e88569cc48d86e9ab4d90538683bfaf6.tar.bz2
etbsa-traccar-web-10cc10e0e88569cc48d86e9ab4d90538683bfaf6.zip
Handle missing string
Diffstat (limited to 'modern/src/map')
-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;