You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add a setter for dragRotate pitchWithRotate option #9666
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.
Would we consider this a regression that we should fix
We don't support internal methods and variables as used here. This is not a regression .
A setter for pitchWithRotate would be the best solution, but is there another way to achieve this effect currently?
@allison-strandberg Have you considered setting the max/min pitch using Map#set[Min/Max]Pitch to lock the pitch to a specific value when the dragstart event is fired?
Activity
ryanhamley commentedon May 7, 2020
@ansis Would we consider this a regression that we should fix for the patch or no since it's technically not part of the public API?
asheemmamoowala commentedon May 13, 2020
We don't support internal methods and variables as used here. This is not a regression .
@allison-strandberg Have you considered setting the max/min pitch using
Map#set[Min/Max]Pitchto lock the pitch to a specific value when thedragstartevent is fired?allison-strandberg commentedon May 14, 2020
Thanks @asheemmamoowala, I'll try that.
[-]pitchWithRotate can no longer be updated in v1.10.0[/-][+]Add a setter for dragRotate pitchWithRotate option[/+]mourner commentedon May 25, 2020
We might want to add a public setter for this. After
v1.10.0, the workaround is to callmap.dragRotate._mousePitch.disable().