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 4 of 4

Need C# example - address to lat/long

This is a discussion on Need C# example - address to lat/long within the MapPoint Desktop Discussion forums, part of the Map Forums category; Does anyone have any C# code snippet that will show me how to convert an address in MapPoint to latitude ...

  1. #1
    tacaldo is offline Junior Member Yellow Belt
    Join Date
    Mar 2005
    Posts
    17

    Need C# example - address to lat/long

    Does anyone have any C# code snippet that will show me how to convert an address in MapPoint to latitude and longitude coordinates?

    Is this activity even possible?

    Thanks in advance to all of you smart people...

  2. #2
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: Need C# example - address to lat/long

    Hi,

    Voila:

    Code:
    FindResults results = MP.ActiveMap.FindAddressResults(street, city, othercity, region, zip, country);
    
    if (results.ResultsQuality <= GeoFindResultsQuality.geoAmbiguousResults)
        foreach (object o in results) {
            Location loc = o as Location;
            if (loc != null) {
                Console.WriteLine(loc.Latitude + " " + loc.Longitude);
                break;
            }
        }

  3. #3
    tacaldo is offline Junior Member Yellow Belt
    Join Date
    Mar 2005
    Posts
    17

    Re: Need C# example - address to lat/long

    I have MapPoint 2004, I get an error saying:

    error CS0117: 'MapPoint.Location' does not contain a definition for 'Latitude'

    Is this property available in MP 2004?

    Thanks

  4. #4
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: Need C# example - address to lat/long

    Hi,

    No sorry this property not available in 2004, but no probleem, try a search on CalcPos on this site from Gilles Kohl. I also have posted it in C#.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Getting the lat/long from an address
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 06-24-2010, 02:49 PM
  2. Adding pushpins by lat/long or address using MPC in MSAccess
    By GM in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 11-01-2004, 01:00 PM
  3. Get address of lat/long
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 05-13-2004, 11:54 AM
  4. Lat. and Long.
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 02-06-2004, 03:09 AM
  5. get lat./long.
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 11-19-2002, 06:56 AM

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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96