2
votes

I'm using Bing Maps in a windows 8 app and I need to display pushpins at numerous locations.

Is there any way to get the GPS coordinates of the corners of the visible map?

Or alternatively a way to get the distance of the visible map? (e.g. 40km width, 60km height)

I need this in order to limit the number of pushpins I attach to the map to just being the ones on the visible part of the map.

2
What have you searched for? Is useful to those trying to help you.Alberto de Paola

2 Answers

1
votes

You can get this information directly from the Bounds property of the map instance, which returns a LocationRect defined by the Northwest and Southeast lat/lng locations shown in the current view. http://msdn.microsoft.com/en-us/library/hh846504.aspx

0
votes

Try using the TryPixelToLocation method.

Location locationOfPixel
if(MyMap.TryPixelToLocation(ThePointToLookUp, out locationOfPixel))
{
    //locationOfPixelshould contain the lat/long of the give point on the map.
}

Obviously, you will need to work out what the pixel locations of the top left, top right, bottom left and bottom right of your map control are and pass them in accordingly.