View Single Post

  #3 (permalink)  
Old 01-12-2005
Wilfried Wilfried is offline
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,112
Hi,

I assume you want the full address?

I assume you use ObjectsFromPoint to get a collection of Location. You do step trought all the objects in the return valud? also be aware that not all objects in this collection are Location objects. If you not consider all this points you will loose addresses.

If I do something like this it returns full address:

Code:
            Location Loc = MP.ActiveMap.GetLocation(Lat, Lon, Alt);
            Loc.GoTo();

            FindResults StreetResults = M.ObjectsFromPoint(M.LocationToX(Loc), M.LocationToY(Loc));

            foreach (object o in StreetResults) {
                Location StreetLoc = o as Location;

                if(StreetLoc != null && StreetLoc.StreetAddress != null) {
                    Console.WriteLine("value    " + StreetLoc.StreetAddress.Value);
                    Console.WriteLine("street   " + StreetLoc.StreetAddress.Street);
                    Console.WriteLine("postcode " + StreetLoc.StreetAddress.PostalCode);
                    Console.WriteLine("city     " + StreetLoc.StreetAddress.City);
                    Console.WriteLine("---");
                    Found = true;
                }
            }
Reply With Quote