mapbox / mapbox/mapbox-gl-js

Easier way to disable all rotation and pitch

Open
#6,531 8 comments 6 reactions 1 assignee View on GitHub

@karimnaaji is already working on this.

Since Jul 9, 2021.

docs :scroll:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

Sadly, most of the maps that I work on have no need for any 3D features or orientations other than north-up. But by default all these navigation features are enabled, which means eventually some poor user accidentally holds down control and gets very confused. Then I fumble through finding how to disable them all:

```
var map = new mapboxgl.Map({
...
pitchWithRotate: false,
dragRotate: false,
touchZoomRotate: false
).addControl(new mapboxgl.NavigationControl({ showCompass: false }), 'top-left');
```

Just a suggestion to consider making this easier, like maybe an option such as "fixedViewport: true" that would imply the others. Or just a note in the documentation explaining the above.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.