Add a setter for dragRotate pitchWithRotate option
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
We want to be able to enable and disable the user's ability to pitch the map after it has been created, and we always want to allow map rotation. Since there is no setter for the pitchWithRotate property, our current approach is to update the value of map.dragRotate._pitchWithRotate as suggested in this issue. After upgrading to version 1.10.0, this no longer works to change the pitchWithRotate setting.
A setter for pitchWithRotate would be the best solution, but is there another way to achieve this effect currently?
mapbox-gl-js version: v1.10.0
browser: Chrome for Mac Version 80.0.3987.163
Steps to Trigger Behavior
- When the map is loaded, drag the map by holding the right mouse button. The map should rotate but not tilt.
- Click the Enable Tilt button.
- Drag the map again: it should now be possible to tilt.
Link to Demonstration
v1.9.1 JSFiddle with intended behavior
v1.10.0 JSFiddle with error
Expected Behavior
The map should start out with rotation enabled and pitch disabled. When the button is clicked, pitch should be enabled.
Actual Behavior
Pitch is not enabled when the button is clicked.
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 at the dragRotate API and its pitchWithRotate handling, using the two linked JSFiddles to compare v1.9.1 and v1.10.0 behavior. Done means a public setter can enable pitch after map creation without disabling rotation, and the demonstrated interaction works.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100