map.dragPan still allows dragging the pan on mobile
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
mapbox-gl-js version: 1.6.1
browser: any mobile browser (tested: edge, chrome, firefox, dolphin)
Steps to Trigger Behavior
- Two fingers on a touch screen
- And drag the camera
Link to Demonstration
this.map = new mapboxgl.Map({
container: 'game_map',
style: 'mapbox://styles/mapbox/light-v10',
center: [location.coords.longitude, location.coords.latitude],
zoom: 20,
touchZoomRotate: {around: 'center'},
scrollZoom: {around: 'center'},
pitch: 60,
bearing: -60,
antialias: true,
attributionControl: false,
dragPan: false,
maxZoom: 22,
minZoom: 17
});
Expected Behavior
When the user tries to drag the pan with two fingers the pan should not move, the user is only allowed to rotate the camera (not move it).
Actual Behavior
When the user tries to drag the pan with two fingers the pan moves with the touch input from the user.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the demonstrated Map configuration on a mobile browser with dragPan disabled, using a two-finger drag. Then trace the touch gesture handling for map panning and rotation. Done means two fingers can rotate the camera without moving its pan position when dragPan is false.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100