Tracking LatLon positions outside the Screen

Jan 15, 2010 at 9:27 AM

Is there a way to track LatLon positions outside of the screen.

I want to track a number of pushpins that go out of the screen, so i know if they are on the left/right/top or bottom position relative to where
the screen is on that moment.

I now use your LatLongToPoint(), it works great but this gives 'NULL' when out of range/screen

Jan 25, 2010 at 9:16 AM

Doesn't anybody have any suggestion how to get Point out of the screen view?

Maybe in a minus value as result like Point(-100,-23)

Jan 25, 2010 at 3:32 PM

Hi Toine,

Sorry I had replied to your first post but I guess the interweb ate it.

Anyway, the Bing Maps 3D API returns null for any points outside of the Earth (like if your screen coordinate is really space) as well as points outside of the screen boundaries. There's nothing I could really do about that.

As a workaround, since it seems like you only need the relative positions of off-screen pushpins rather than exact lat/longs, I would suggest that if LatLongToPoint returns null, then take the current map lat/long and compare it to your pushpin's latlong. If you do a little bit of vector math, you can figure out the angle between the top of the screen and your pushpin.


P = pushpin
C = center of map
T = top of screen, arbitrary point above the center

T   P
|  /
| /

Each of the points T, C, and P you know the latitude and longitude. (Find T by calling LatLongtoPoint with a point above the center.) If you consider the two vectors CT and CP and calculate the angle between them, you can then figure out where to put your off-screen pushpin marker.

Jan 27, 2010 at 12:53 PM

Thanks, this will help me to creat a estimated position.