缩放以显示 bing 地图中的所有位置 [英] Zoom to show all locations in bing maps

查看:23
本文介绍了缩放以显示 bing 地图中的所有位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有 3 个图钉:(1) 加利福尼亚,(2) 佛罗里达,(3) 纽约.为了让所有 3 个都可见,我必须缩小到足够远才能看到整个国家.但是说我有(1)加利福尼亚,(2)内华达,(3)德克萨斯.我必须缩小才能覆盖美国的西南角.Windows Phone 7 API 的 bing 映射中是否有任何功能可以帮助我解决这个问题.基本上,我想缩小到足以看到一组位置.

Say I have 3 pushpins: (1) California, (2) Florida, (3) New York. In order for all the 3 of them to be visible, I'd have to zoom out far enough to pretty much see the whole country. But say instead of that I had (1) California, (2) Nevada, (3) Texas. I'd have to zoom out only to cover the south west corner of the US. Is there any function in the bing maps for Windows Phone 7 API that helps me with this. Basically, I want to zoom out just enough to see a set of locations.

谢谢!

推荐答案

是的.有可能的.CurrentItems 是我的地图的来源.

Yes. it is possible. CurrentItems is source for my map.

var locations = CurrentItems.Select(model => model.Location);
map.SetView(LocationRect.CreateLocationRect(locations));

这篇关于缩放以显示 bing 地图中的所有位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆