Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapbox-gl地图的pitch如何能够突破60 #27

Open
Particaly opened this issue Dec 11, 2019 · 5 comments
Open

Mapbox-gl地图的pitch如何能够突破60 #27

Particaly opened this issue Dec 11, 2019 · 5 comments

Comments

@Particaly
Copy link

mapboxgl地图的pitch最大值被限定为60,需要配合three实现一个天空盒效果,pitch的值能否突破60?或者这个问题将在未来得到解决?

@dazhi1011
Copy link

@Particaly 先回答问题,不改源码的情况下目前是突破不了的。

简单解释下,假设你了解透视投影,如下图所示,射线左端为视点、右端为观察点,两条虚线夹角为fov,自然双实线即为地图可视范围;pitch增大即由(a)到(b),双虚线部分即为增加的地图可视范围,需要额外加载一部分地图数据。想象一下,当pitch增大到接近90°时,增加的双虚线部分也将趋向于无穷,如果此时不对加载的地图范围做限制,当前zoom下地图加载也将趋向于无穷……

pitch

当前pitch限制为60°我猜也是一个折中的选择吧,希望对你有帮助。

@Particaly
Copy link
Author

是的,我尝试修改了源码中的transform部分的代码,的确突破了60的限制,但是mapbox会加载更多甚至无穷远处的数据,或许mapbox能够相对于地图当前中心点更远处(例如距离超过一定范围)做出限制加载数据,但是如何实现我并没有思路,如果可行的话,希望官方可以考虑实现一下,同时谢谢你的解答!

@dazhi1011
Copy link

@Particaly 既然都看到transform了,何不再试一试,提供个思路共同探讨:
把限制加载的判断逻辑加到coveringTiles方法中;再进一步,在地图边缘处对应的z深度添加个遮挡层,效果会好一点。

@ParryQiu
Copy link

ParryQiu commented Dec 24, 2019

这里有相关的讨论以及实现方法。
mapbox/mapbox-gl-js#3731

详细可以参见这个 PR
mapbox/mapbox-gl-js#8975

@defineconst
Copy link

v2 已经到90度了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants