Welcome to MapForums!

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

getAddress(ldouble lat, double lon) (And a question with it)

This is a discussion on getAddress(ldouble lat, double lon) (And a question with it) within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi All, i'm using this function.. and i wonnna share this with other members.. it seem that many have the ...

1. Member Yellow Belt
Join Date
Dec 2004
Posts
47

getAddress(ldouble lat, double lon) (And a question with it)

Hi All,
i'm using this function.. and i wonnna share this with other members.. it seem that many have the same question.. how do i transform a lat/lon to a valid address.. here we go.. this is the function i use..

Code:
```public override string getAddress&#40;double lat, double lon&#41;
&#123;

MapPoint.FindResults results;
MapPoint.Location mLoc = this.mMap.Location.Location;
mLoc = this.mMap.GetLocation&#40;lat, lon&#41;;
results = this.mMap.ObjectsFromPoint&#40;this.mMap.LocationToX&#40;mLoc&#41;, this.mMap.LocationToY&#40;mLoc&#41;&#41;;

foreach &#40;object o in results&#41;
&#123;
try
&#123;
MapPoint.Location Loc = &#40;MapPoint.Location&#41;o;

if &#40;Loc != null&#41;
&#123;
&#125;
&#125;
catch&#40;System.Exception ex&#41;
&#123;

&#125;
&#125;

&#125;```
this is c# code.. but can be easly transformned to vb.

I've got a question bout the way mappoint handles this problem to.. the result of this functions vary from map zoom in my app.. at different zoom i have different results.. for someone knows much.. is there a way to get the most precise info????

regards,
Gianmaria

2. Senior Member Black Belt
Join Date
Nov 2004
Location
Belgium
Posts
2,433
Hi,

Thanks for feedback. This sure benefit others !

I did edit your message to put the code into "code" block for better readability. I hope you dont mind

Yes Mappoint is more or less human From a large altitude it does not see all details

I have had weard results sometime with Atlitude of 0, and I always seems to have good results with Altitude of 1