当显示多个完整地球时,以低变焦显示两个多边形(包裹它们)
如何将形状包裹在世界各地,以便在低缩放时多次显示形状?
示例:
- 我在美国上绘制了一个多边形。
- 我缩小以便可以看到两个美国。
- 我只看到一个多边形:(我想看到两个!
How can I wrap shapes around the world, so that a shape is shown more than once at low zoom?
Example:
- I draw a polygon over USA.
- I zoom out so that I can see two USA's.
- I only see one polygon: ( I want to see two!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
地图数据实际上有 2 个美国。这意味着您实际上应该需要 2 个多边形,其中一个大部分时间都会被隐藏。
不妨考虑最坏的情况,将单个美国视为例外而不是规则。
The map data effectively has 2 USAs. That implies you should actually want 2 polygons, one of which will be hidden most of the time.
Might as well cater for the worst case and treat a single USA as the exception rather than the rule.
你不能。
正如其他人已经指出的那样,事实是,在远缩放级别上,某些功能会在地图的两侧重复,这是支持连续滚动的投影表面的一个不需要但不可避免的副作用。这只是 Bing 地图控件最新版本中的一个问题 - 早期的 v6.x 控件阻止地图平移穿过 180 度子午线。
我想不出您想要显示两个美国的任何可能原因,更不用说在每个美国上定位目标数据了。因此,解决方案是修改地图显示的缩放级别或显示地图的应用程序窗口的大小,以便不会发生这种情况。
You can't.
As others have already pointed out, the fact that, at far zoom levels certain features get repeated on either side of the map is an unwanted but inevitable side-effect of a projected surface that enables continuous scrolling. This has only been an issue in recent versions of the Bing Maps control - the earlier v6.x control prevented the map from panning across the 180th meridian.
I cannot think of any possible reason why you'd ever want to show two USAs, let alone target data to be positioned on each one. So the solution is to modify either the zoom level at which the map is displayed, or the size of the application window in which it is being displayed so that this situation doesn't occur.