From 6bcd8a34814b6979ad946ad1e02377441952cdcb Mon Sep 17 00:00:00 2001 From: Zsolt Ero Date: Wed, 25 Sep 2024 14:54:29 +0200 Subject: [PATCH] map controls, disable drag rotate --- website/public/scripts/map.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/website/public/scripts/map.js b/website/public/scripts/map.js index 573a079..04a53c6 100644 --- a/website/public/scripts/map.js +++ b/website/public/scripts/map.js @@ -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 @@ -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