Skip to content

Commit

Permalink
feat: disable rotate & pitch on the map on touch & desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
th0rgall committed Jun 10, 2024
1 parent 84f8a81 commit 42cefcf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lib/components/Map/Map.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,14 @@
/** https://docs.mapbox.com/mapbox-gl-js/api/map/#map-parameters */
maxZoom: $user?.superfan ? memberMaxZoom : nonMemberMaxZoom,
attributionControl: false,
hash: false // TODO: discuss if we want this or not,
hash: false, // TODO: discuss if we want this or not,
// Disable rotating and changing pitch (tilt) on mobile & desktop
dragRotate: false,
touchPitch: false
});
map.touchZoomRotate.disableRotation();
map.addControl(
new maplibregl.NavigationControl({ showCompass: false, showZoom: true }),
'top-left'
Expand Down

0 comments on commit 42cefcf

Please sign in to comment.