aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/main.js b/main.js
index ba799f1..a5883de 100644
--- a/main.js
+++ b/main.js
@@ -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');