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));
精彩评论