This is a C# wrapper around the
Google Maps route directions web service. It can be used from any .NET application,
but the Google terms and conditions do state
the Directions API may only be used in
conjunction with displaying results on a Google map; using Directions data
without displaying a map for which directions data was requested is prohibited
Download the source code (uses Visual Studio 2015).
Download the assembly (requires .NET Framework 4.6).
Here's an example of getting directions
var directions = new RouteDirections(API_KEY); var route = directions.GetRoute(false, new Location("Preston, UK"), new Location("Darwen, UK"), new Location("Lancaster, UK"), new Location("Burnley, UK"), new Location("Blackpool, UK"), new Location("Morecambe, UK"));
Here's an example of geocoding
var geocoder = new Geocoder(API_KEY); var locations = geocoder.Geocode("Hawks Road, Kingston, UK");
Here's an example of reverse geocoding
var geocoder = new Geocoder(API_KEY); var address = geocoder.ReverseGeocode(new LatLng(51.408580, -0.292470));
Here's an example of getting elevation data
var elevService = new ElevationService(API_KEY); var elev = elevService.GetElevation(new LatLng(51.40862, -0.292332));