Skip to content

Commit

Permalink
Add scale control and disable map skew/rotate
Browse files Browse the repository at this point in the history
  • Loading branch information
watmildon authored Dec 25, 2024
1 parent f0445c5 commit 4e038ba
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/js/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 4e038ba

Please sign in to comment.