Skip to content

Commit 6bcd8a3

Browse files
committed
map controls, disable drag rotate
1 parent b284178 commit 6bcd8a3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

website/public/scripts/map.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ function initMap() {
3232
container: mapDiv,
3333
boxZoom: false,
3434
// doubleClickZoom: false,
35-
scrollZoom: false,
35+
// scrollZoom: false,
3636
attributionControl: false,
37+
cooperativeGestures: true,
38+
dragRotate: false,
3739
})
3840
window.map = map
3941

@@ -64,11 +66,13 @@ function selectStyle(style) {
6466
map.setPitch(london3d.pitch)
6567
map.setBearing(london3d.bearing)
6668
map.setZoom(london3d.zoom)
69+
map.dragRotate.enable()
6770
} else if (map.getBearing() !== 0) {
6871
map.setCenter(berlin.center)
6972
map.setPitch(berlin.pitch)
7073
map.setBearing(berlin.bearing)
7174
map.setZoom(berlin.zoom)
75+
map.dragRotate.disable()
7276
}
7377

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

0 commit comments

Comments
 (0)