From 4e038ba972280a72d2a1496ec432b2b23f4cbe24 Mon Sep 17 00:00:00 2001 From: Matt Whilden <118567155+watmildon@users.noreply.github.com> Date: Tue, 24 Dec 2024 22:29:37 -0800 Subject: [PATCH] Add scale control and disable map skew/rotate --- docs/js/setup.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/js/setup.js b/docs/js/setup.js index 80a8222..994a18e 100644 --- a/docs/js/setup.js +++ b/docs/js/setup.js @@ -98,6 +98,15 @@ document.addEventListener("alpine:init", async () => { map.setPadding({ top: 57 }); + var scale = new maplibregl.ScaleControl({ + maxWidth: 200, + unit: "metric", + }); + map.addControl(scale); + + map.dragRotate.disable(); + map.touchZoomRotate.disableRotation(); + map.on("load", () => { let select = document.querySelector("#selected_tileset"); select.addEventListener("change", (e) => {