Community of MapPoint and Virtual Earth Users and Developers
This is a discussion on getAddress(ldouble lat, double lon) (And a question with it) within the MapPoint 2006/2009 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 ...
| |||||||
| Today's Posts | Twitter Feed | Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| getAddress(ldouble lat, double lon) (And a question with it) 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(double lat, double lon)
{
string address = "";
MapPoint.FindResults results;
MapPoint.Location mLoc = this.mMap.Location.Location;
mLoc = this.mMap.GetLocation(lat, lon);
results = this.mMap.ObjectsFromPoint(this.mMap.LocationToX(mLoc), this.mMap.LocationToY(mLoc));
foreach (object o in results)
{
try
{
MapPoint.Location Loc = (MapPoint.Location)o;
if (Loc != null)
{
address += Loc.StreetAddress.City + " - " + Loc.StreetAddress.Street;
}
}
catch(System.Exception ex)
{
}
}
System.Diagnostics.Trace.WriteLine(address);
return address;
}
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 |
| |||
|
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 I have had weard results sometime with Atlitude of 0, and I always seems to have good results with Altitude of 1
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
| Tags |
| double, getaddressldouble, lat, lon, question |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| vb.net to c# question... | starbuck | MapPoint 2006/2009 Discussion | 0 | 09-14-2004 04:07 AM |
| question | Anonymous | Wish List | 0 | 07-12-2004 06:05 AM |
| Double Click on a Pushpin | Anonymous | MapPoint 2006/2009 Discussion | 4 | 02-28-2004 06:26 PM |
| Double Click on map | Anonymous | MapPoint 2006/2009 Discussion | 0 | 08-08-2003 06:42 PM |
Dalaman Holiday
Enjoy a wonderfully peaceful Dalaman holiday... Book through UlookUbook and save!