Johan B
Johan B

Reputation: 1976

Bing Virtual Earth 7.0 calculate area

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.

Upvotes: 2

Views: 361

Answers (1)

Alastair Aitchison
Alastair Aitchison

Reputation: 3532

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)

Upvotes: 1

Related Questions