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
Results 1 to 2 of 2

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. #1
    Gianmaria is offline 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(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;
    }
    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. #2
    Wilfried is offline 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)

Similar Threads

  1. vb.net to c# question...
    By starbuck in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 09-14-2004, 05:07 AM
  2. question
    By Anonymous in forum Wish List
    Replies: 0
    Last Post: 07-12-2004, 07:05 AM
  3. Double Click on a Pushpin
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 02-28-2004, 07:26 PM
  4. Double Click on map
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 08-08-2003, 07:42 PM

Tags for this Thread

Posting Permissions

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


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25