Skip to content

Commit

Permalink
map controls, disable drag rotate
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperknot committed Sep 25, 2024
1 parent b284178 commit 6bcd8a3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion website/public/scripts/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ function initMap() {
container: mapDiv,
boxZoom: false,
// doubleClickZoom: false,
scrollZoom: false,
// scrollZoom: false,
attributionControl: false,
cooperativeGestures: true,
dragRotate: false,
})
window.map = map

Expand Down Expand Up @@ -64,11 +66,13 @@ function selectStyle(style) {
map.setPitch(london3d.pitch)
map.setBearing(london3d.bearing)
map.setZoom(london3d.zoom)
map.dragRotate.enable()
} else if (map.getBearing() !== 0) {
map.setCenter(berlin.center)
map.setPitch(berlin.pitch)
map.setBearing(berlin.bearing)
map.setZoom(berlin.zoom)
map.dragRotate.disable()
}

document.getElementById('style-url-code').innerText = styleUrl
Expand Down

0 comments on commit 6bcd8a3

Please sign in to comment.