简体   繁体   English

Mapbox Gl Js轴承自动重置为零

[英]Mapbox gl js bearing auto reset to zero

Mapbox gl js default rotate behavior is following: when user stop rotating map with bearing value close to zero (+-5deg) then map will auto correct bearing value to zero. Mapbox gl js的默认旋转行为如下:当用户停止旋转方位角值接近零(+ -5deg)的地图时,地图将自动将方位角值校正为零。 My question is: how to disable this behavior? 我的问题是:如何禁用此行为?

According to the documentation , the default is 7 degrees. 根据文档 ,默认值为7度。 You should be able to set it to zero (ie, no automatic snap) by doing this: 您应该可以通过以下操作将其设置为零(即没有自动捕捉):

var map = new mapboxgl.Map({
   ...
   bearingSnap: 0
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM