views:

102

answers:

1

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/coordinates?

+4  A: 

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));
Barranger Ridler
SetView!!! How did I miss this one??? Bwahahah!!!
Martin Plante