Disable compass interactivity for `interactive: false` maps
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**: v1.2.1
**browser**: Chrome/Firefox, likely any
### Steps to Trigger Behavior
https://docs.mapbox.com/mapbox-gl-js/example/animate-camera-around-point/ with
`interactive: false` and
```
map.addControl(new mapboxgl.NavigationControl({
visualizePitch: true,
showZoom: false
}));
```
### Link to Demonstration
https://jsbin.com/yatuvegeti/1/edit?html,output
### Expected Behavior
It's not possible for the user to interrupt/alter the animation. Also the compass tooltip _Reset bearing to north_ should not be displayed.
### Actual Behavior
It's possible to rotate / tilt the map dragging the compass icon and the tooltip is displayed.
---
One could argue that this is not a bug, because the compass is a navigation control. In this case it would be appreciated if this issue would be considered as feature request. It would be useful to be able to use the compass for indicating bearing/pitch while animating the camera and the user is not able to interrupt/alter the animation.
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 animate-camera-around-point example and its NavigationControl configuration, then trace how interactive: false affects compass dragging and the Reset bearing to north tooltip. Done means the compass can still indicate bearing and pitch without letting users alter the camera or showing the tooltip when interactivity is disabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100