mirror of
https://github.com/hyperknot/openfreemap.git
synced 2026-05-21 14:02:15 +00:00
map controls, disable drag rotate
This commit is contained in:
@@ -32,8 +32,10 @@ function initMap() {
|
|||||||
container: mapDiv,
|
container: mapDiv,
|
||||||
boxZoom: false,
|
boxZoom: false,
|
||||||
// doubleClickZoom: false,
|
// doubleClickZoom: false,
|
||||||
scrollZoom: false,
|
// scrollZoom: false,
|
||||||
attributionControl: false,
|
attributionControl: false,
|
||||||
|
cooperativeGestures: true,
|
||||||
|
dragRotate: false,
|
||||||
})
|
})
|
||||||
window.map = map
|
window.map = map
|
||||||
|
|
||||||
@@ -64,11 +66,13 @@ function selectStyle(style) {
|
|||||||
map.setPitch(london3d.pitch)
|
map.setPitch(london3d.pitch)
|
||||||
map.setBearing(london3d.bearing)
|
map.setBearing(london3d.bearing)
|
||||||
map.setZoom(london3d.zoom)
|
map.setZoom(london3d.zoom)
|
||||||
|
map.dragRotate.enable()
|
||||||
} else if (map.getBearing() !== 0) {
|
} else if (map.getBearing() !== 0) {
|
||||||
map.setCenter(berlin.center)
|
map.setCenter(berlin.center)
|
||||||
map.setPitch(berlin.pitch)
|
map.setPitch(berlin.pitch)
|
||||||
map.setBearing(berlin.bearing)
|
map.setBearing(berlin.bearing)
|
||||||
map.setZoom(berlin.zoom)
|
map.setZoom(berlin.zoom)
|
||||||
|
map.dragRotate.disable()
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById('style-url-code').innerText = styleUrl
|
document.getElementById('style-url-code').innerText = styleUrl
|
||||||
|
|||||||
Reference in New Issue
Block a user