Bing Virtual Earth 7.0 calculate area

流过昼夜 提交于 2019-12-11 00:44:01

问题


I have a map where i have created pushPin for all the places i have checked in on facebook. I want to zoom in on the area where i have the most checkinplaces (pushPins).

I could have a static zoom level and calculate some kind of median value but if i check in 20 times in Paris and 20 times in Los Angeles I'd end up somewhere in the middle of the Atlantic Ocean (or the North Pacific or something).

I have an array with all the locations (longitudes and latitudes) to play with.


回答1:


You can create a bounding box that covers the extent of the pushpins in your array using the LocationRect.fromLocations() method (http://msdn.microsoft.com/en-us/library/gg427621.aspx).

Then, simply centre the map on this view by passing the LocationRect to the "bounds" property of the map.setView method. (http://msdn.microsoft.com/en-us/library/gg427628.aspx)



来源:https://stackoverflow.com/questions/7107536/bing-virtual-earth-7-0-calculate-area

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