mapbox gl js盖缩放以避免重复世界

发布于 2025-01-25 17:31:51 字数 107 浏览 2 评论 0原文

我想限制用户可以缩放多少,以使区域从未在地图上显示两次。我尝试将RenderWorldCopies设置为false,但是缩放时地图的宽度减小。在将地图宽度保持在可用宽度的100%时,我该如何限制放大?

I'd like to limit how much the user can zoom out, such that a region is never displayed twice on the map. I tried setting renderWorldCopies to false, but then the width of the map decreases when zooming out. How can I limit zooming out while keeping the map width at 100% of available width?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

三生殊途 2025-02-01 17:31:51

您可以在实例化地图时设置minzoom

const map = mapboxgl.Map({ /*...*/,  minZoom: 2 })

You can set minZoom when instantiating the map:

const map = mapboxgl.Map({ /*...*/,  minZoom: 2 })
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文