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...
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 ...
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...
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; } }
rgds, Wilfried Mestdagh
www.mestdagh.biz
www.comfortsoftware.be
www.expertsoftware.be
MapPoint coding demo
MapPoint 2011 available, buy now
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
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#.
rgds, Wilfried Mestdagh
www.mestdagh.biz
www.comfortsoftware.be
www.expertsoftware.be
MapPoint coding demo
MapPoint 2011 available, buy now
There are currently 1 users browsing this thread. (0 members and 1 guests)