diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2024-01-14 04:10:04 +0100 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2024-01-14 04:14:17 +0100 |
commit | 45612b34682aaab64134fa4dd5acf2577fc372e6 (patch) | |
tree | 59e4bd4a12b7757d48b17ffe6b11bad71e5da587 | |
parent | 4746a852ec0617561b4a211954a14db2f886bda0 (diff) |
Shorten scale bar on smaller screens.
-rw-r--r-- | main.js | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -171,9 +171,11 @@ map.getViewport().appendChild(container); /* scale line */ (function() { + const size = map.getSize(); const control = new ScaleLine({ units: 'metric', minWidth: 150, + maxWidth: size[1] < 350 ? size[1] - 50 : 350, target: container, }); control.element.classList.add('modal', 'modal-content'); |