Fix panning in enlarged MiniMap on mobile devices

pull/10/head
Manuel Kasper 2020-12-05 22:34:03 +01:00
rodzic db0b5840f2
commit 22baf3eb08
1 zmienionych plików z 16 dodań i 14 usunięć

Wyświetl plik

@ -140,21 +140,23 @@ export default {
// Workaround to let users scroll page on mobile devices without inadvertently
// panning the map, while still being able to pan it with two fingers
// See also: https://github.com/mapbox/mapbox-gl-js/issues/2618
this.map.on('touchstart', (e) => {
if (!this.$mq.mobile || this.isEnlarged) {
return
}
let oe = e.originalEvent
if (oe && 'touches' in oe) {
if (oe.touches.length > 1) {
oe.stopImmediatePropagation()
this.map.dragPan.enable()
} else {
this.map.dragPan.disable()
if (this.$mq.mobile) {
this.map.on('touchstart', (e) => {
if (this.isEnlarged) {
return
}
}
})
let oe = e.originalEvent
if (oe && 'touches' in oe) {
if (oe.touches.length > 1) {
oe.stopImmediatePropagation()
this.map.dragPan.enable()
} else {
this.map.dragPan.disable()
}
}
})
}
this.showHideInactiveSummits()
this.highlightCurrentSummit()
},