Skip to content

A Rust crate to build URLs for Google Maps Static APIs

License

Notifications You must be signed in to change notification settings

lmammino/gmaps-static

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gmaps_static

Rust codecov crates.io badge Documentation

Work in progress...

Example

use gmaps_static::*;

let map = Map::new("YOUR_API_KEY".into(), (400, 300).into())
    .scale(SCALE2)
    .center("Colosseo".into())
    .zoom(STREETS)
    .format(GIF)
    .maptype(HYBRID)
    .region("it".into())
    .language("it".into());

println!("{}", map.url());

This will generate the following URL:

https://maps.googleapis.com/maps/api/staticmap?size=400x300&center=Colosseo&scale=2&format=gif&maptype=hybrid&language=it&region=it&key=YOUR_API_KEY

A map of the area sorrounding the Coliseum generated with GMapsStatic

Features

  • center
  • zoom
  • size
  • scale
  • format
  • maptype
  • language
  • region
  • markers
  • paths
  • viewports (visible parameter)
  • styled maps
    • support for map_id parameter
    • support for URL-based styles (style parameter)
  • Clientid authentication

TODO list pre-1.0.0

  • Remove ambiguous type aliases in favour of wrapper types
  • Remove immutability and implement clone() in builder struct
  • Better error management
  • Proper crate documentation
  • Examples
  • More test (support for all examples in the official docs)

Contributing

Everyone is very welcome to contribute to this project. You can contribute just by submitting bugs or suggesting improvements by opening an issue on GitHub.

License

Licensed under MIT License. © Luciano Mammino.

About

A Rust crate to build URLs for Google Maps Static APIs

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages