Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

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

 Subscribe to receive our newsletter. Subscribe Unsubscribe

## 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;
string address = "";

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;
address +=  Loc.StreetAddress.City + " - " + Loc.StreetAddress.Street;
&#125;
&#125;
catch&#40;System.Exception ex&#41;
&#123;

&#125;
&#125;

System.Diagnostics.Trace.WriteLine&#40;address&#41;;
return address;
&#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

#### Thread Information

##### Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•