mapbox/mapbox-gl-js

Disable compass interactivity for `interactive: false` maps

Open

#8.618 geöffnet am 10. Aug. 2019

Auf GitHub ansehen
 (10 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (2.203 Forks)batch import
good first issue

Repository-Metriken

Stars
 (10.532 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

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