开发者

Set a map's top-left and bottom-right coordinates

I have a fixed number of pushpins on a Bing Map control, and need to set the map's center and zoom level so that I see all pins. In other words, knowing the leftmost, rightmost, topmost and bottommost pins, how can I adjust the view so I see them all?

Is the ZoomLevel value of any significance relative to the scaling/c开发者_运维百科oordinates?


assuming that Points is your collection of Pushpins and map is the name of your map :)

var x = from l in Points
        select l.Location;

map.SetView(LocationRect.CreateLocationRect(x));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜