Google Maps API .NET wrapper

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).

Read the documentation.

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));

Change History

2.0.0.2 - Added Geocoder.ReverseGeocodeComponents to return address components when reverse geocoding
2.0.0.1 - Interface changed so classes are no longer static and the API key must be provided.
Added support for the elevation service.
1.0.0.3 - Bug fix provided by Guillermo E
1.0.0.2 - Added the Geocoder class for geocoding and reverse geocoding
1.0.0.1 - Initial release