How to enable Map Pitch when `dragRotate.disable()` & `touchZoomRotate.disableRotation()`
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**:
```
"@mapbox/mapbox-gl-draw": "^1.2.2",
"@mapbox/mapbox-gl-geocoder": "^4.7.0",
"mapbox-gl": "^2.2.0",
```
### Question
How to enable pitch when dragRotate.disable() & touchZoomRotate.disableRotation() ?
I have two checkbox to enable the feature, namely `Allow Map Pitch` & `Allow Map Bearing`.
And here is a snippet of my js code:
```
if(!data.allowBearing){
map.dragRotate.disable();
map.touchZoomRotate.disableRotation();
}
if(!data.allowPitch){
map.setMaxPitch(0);
map.setMinPitch(0);
}
```
The "Allow Map Pitch" checkbox is working only if the "Allow Map Bearing" checkbox is active. How to make disable bearing but allow pitch?
I have carefully read [the documentation on the official website](https://docs.mapbox.com/mapbox-gl-js/api/), and searched for previous issues both here and from Google sources. However, I haven't found the right questions and answers.
Thank you.
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 with the API entry points shown in the issue: map.dragRotate.disable(), map.touchZoomRotate.disableRotation(), and the pitch limit methods. Compare their documented behavior and inspect the related interaction-handler implementation. Done means establishing whether pitch can work independently of bearing, then documenting the supported configuration or defining the needed change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- frontend, web-dev
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100