作者:为爱进地狱天堂_954 | 来源:互联网 | 2023-09-08 19:44
InV2therewasawaytolimitpanningdraggingsothemapstayswithincertainbounds.Howisthat
In V2 there was a way to limit panning/dragging so the map stays within certain bounds. How is that done in V3?
在V2中,有一种限制平移/拖动的方法,因此映射保持在一定的范围内。在V3中是怎么做到的?
Let's say I want the users to only look at Europe. I've already limited the zoom, but if I allow dragging (which I have to in this case, for other reasons) then the user can pan beyond the area I want to show.
假设我希望用户只关注欧洲。我已经限制了缩放,但是如果我允许拖动(在这种情况下,由于其他原因,我必须这么做),那么用户就可以在我想要显示的区域之外移动。
Please give working example or code snippet - I'm not an expert coder...
请给出工作示例或代码片段——我不是专业的程序员……
Thanks!
谢谢!
14 个解决方案