问题
I've tried using map.SetView(LocationRect.CreateLocationRect(locations));
But the thing is I need the all the pushpins to be shown as well. Using the above method only takes the location into account. Some pushpins gets cropped especially corner ones.
Is there a better way to do this? Thanks.
回答1:
LocationRect.CreateLocationRect(locations)
gives you the binding box of the locations, so you could artificially inflate that a little (for example, by adding/subtracting a tenth of a degree from each edge) before passing it to SetView
回答2:
You can increase the zoom level of map so that pushpins will be visible...
try this.
map1.ZoomLevel = 5;
来源:https://stackoverflow.com/questions/10828906/windows-phone-map-control-show-all-locations-zoom-to-include-all-pushpins