调整地图大小时 Bing Maps AJAX 中出现自动平移问题?

发布于 2024-10-03 03:01:18 字数 328 浏览 0 评论 0原文

我正在开发一个项目,其中我们根据地图左侧是否显示/隐藏面板来调整 Bing 地图的大小。因此,以及 Microsoft 的条款禁止在徽标/版权等上覆盖任何内容,我使用 VEMap.resize 方法来调整地图大小,然后将面板移开。问题是,在调整大小的过程中会出现一个尴尬的自动平移 - 因为我们声明了一个中心点来确定调整大小,所以地图平移以将该点包含在中心,而无需对其进行任何控制。如果不声明中心,地图不会平移,但它也不会在我们调整大小时提取新数据(地图图块),从而导致右侧出现尴尬的灰色条。.

有一个简单的方法吗?如何调整地图大小并禁用自动平移,在平移之前移动中心,或者强制在调整大小本身时渲染地图图块?任何帮助将不胜感激。

Am working on a project where we have a Bing map being resized depending on whether or not a panel is shown/hidden on the left-hand side of the map. Because of this, and Microsoft's terms preventing overlaying anything over the logo/copyright, etc, I'm using the VEMap.resize method to resize the map, and then am moving the panel out of the way. The issue is that there's an awkward autopan that occurs as part of the resize - because we're declaring a center point to determine the resize, the map pans to include this point in the center without any control over it. Without declaring a center, the map doesn't pan, but it also doesn't pull the new data (map tiles) in our resize in either, resulting in an awkward grey bar on the right-hand side..

Is there a simple way to either resize the map and disable that autopan, moving the center prior to the panning, or to force the map tiles to be rendered upon the resize itself? Any help would be appreciated.

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

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

发布评论

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

评论(1

迷鸟归林 2024-10-10 03:01:18

您可能想尝试新版本 7.0,因为您可以在调整大小后使用“map.setView({center: map.getCenter(), animate:false})”来摆脱这种烦恼;这应该会覆盖调整大小时漂亮但烦人的平移移动。

然而,当从 6.3 迁移时,7.0 目前缺少一些功能(如信息框或客户端集群),并且类名发生了变化,因此您可能需要等待,但这将是为 7.0 做好准备的好时机。

You may want to try the new version 7.0 as you could get rid of this annoyance by using "map.setView({center: map.getCenter(), animate:false})" after resizing; that should override the nice but annoying pan movement on resize.

However there are a few features (like infoboxes or client-side clustering) currently missing in 7.0 when migrating from 6.3 however and the classnames changed, so you may want to wait for now, however it would be the good moment to prepare yourself for 7.

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