windows phone map control show all locations (zoom to include all pushpins)

百般思念 提交于 2019-12-24 07:15:34

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!