An unofficial Google Maps Platform client for the Rust programming language. This client currently implements the Directions API, Distance Matrix API, Elevation API, Geocoding API, and Time Zone API.
Welcome
This crate is expected to work well and have the more important Google Maps features implemented. It should work well because Reqwest and Serde do most of the heavy lifting! While it's an early release, this crate should work fine as is for most people.
I created this library because I needed several Google Maps Platform features for a project that I'm working on. So, I've decided to spin my library off into a public crate. This is a very small token of gratitude and an attempt to give back to the Rust community. I hope it saves someone out there some work.
Feedback
I would like for you to be successful with your project! If this crate is not working for you, doesn't work how you think it should, if you have requests, or suggestions - please contact me. I'm not always fast at responding but I will respond. Thanks!
Example Directions API Request
use *;
let directions = new
.with_travel_mode
.with_arrival_time
.execute.unwrap;
println!;
Example Distance Matrix API Request
use *;
// Example request:
let distance_matrix = new
.execute.unwrap;
// Dump entire response:
println!;
Example Elevation API Positional Request
use *;
// Example request:
let elevation = new
.positional_request
.execute.unwrap;
// Dump entire response:
println!;
// Parsing example:
println!;
Example Geocoding API Request
use *;
// Example request:
let location = new
.with_address
.execute.unwrap;
// Dump entire response:
println!;
// Parsing example:
for result in &location.results
Example Reverse Geocoding API Request
use *;
// Example request:
let location = new
.with_result_type
.execute.unwrap;
// Dump entire response:
println!;
// Parsing example:
for result in &location.results
Example Time Zone API Request
use *;
// Example request:
let time_zone = new.execute.unwrap;
// Dump entire response:
println!;
// Parsing example:
use ;
let unix_timestamp =
now.duration_since.unwrap.as_secs;
println!;
println!;
Geolocation API
Google's Geolocation API seems to be offline. While the online documentation
is still available and the API appears configurable through the Google Cloud
Platform console, the Geolocation API responds Status code 404 Not Found
with
an empty body to all requests. This API cannot be implemented until the server
responds as expected.
To do
- Convert explicit query validation to session types wherever reasonable.
- Places API
- Roads API
- Retry on Failure
- Automatic Rate Limiting