A wrapper for the Google Maps API for Arduino (works on ESP8266). Available on the Arduino library manager.
There are now two different parts of the API implemented and they can be used separately (They are independent of each other)
Link to Directions API documentation
This is probably the better of the two APIs (which have similar functions)
- Supports travel times (including traffic) between two locations
- Also supports waypoints (which basically travel time between A->B via C)
- Supports more optional inputs (avoid, units)
- Returns a struct object with the more useful info from the response
- Maybe slightly slower than DistanceMatrix as the response is very large (although the library minimises this, by only parsing the useful info)
Note: that only one of the headers of this library is used: GoogleMapsDirectionsApi.h
The Directions part of the library requires Squix78's Json Streamer Parser, which can be installed via the arduino library manager.
- Go to this page
- Scroll down and in "Quick Start Steps" section, click "Get Key"
- Make sure the following URL works for you in your browser (Change the key at the end!): https://maps.googleapis.com/maps/api/directions/json?origin=Galway&destination=Dublin,Ireland&departure_time=now&waypoints=via:cork,ireland&key=PutYourNewlyGeneratedKeyHere
Link to Distance Matrix API documentation
This is the API that was implemented in the first version of the library.
- Supports travel times (including traffic) between two locations
- Returns the full response from Google as a String in JSON format
- Maybe slightly faster than Directions as the response is much smaller
Note: that only one of the headers of this library is used: GoogleMapsApi.h
The Distance Matrix part of the library requires Benoît Blanchon's ArduinoJson library, which can be installed via the arduino library manager.
- Go to this page
- Scroll down and in "Quick Start Steps" section, click "Get Key"
- Make sure the following URL works for you in your browser (Change the key at the end!): https://maps.googleapis.com/maps/api/distancematrix/json?origins=Galway,+Ireland&destinations=Dublin,Ireland&departure_time=now&traffic_model=best_guess&key=PutYourNewlyGeneratedKeyHere