Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/martinlindhe/google-geolocate
Golang client for the Google Maps Geolocation API
https://github.com/martinlindhe/google-geolocate
golang-library google-geocode google-geolocation
Last synced: about 2 months ago
JSON representation
Golang client for the Google Maps Geolocation API
- Host: GitHub
- URL: https://github.com/martinlindhe/google-geolocate
- Owner: martinlindhe
- License: mit
- Created: 2016-09-29T15:10:19.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-10-21T10:07:38.000Z (about 3 years ago)
- Last Synced: 2024-10-14T20:59:59.842Z (2 months ago)
- Topics: golang-library, google-geocode, google-geolocation
- Language: Go
- Size: 15.6 KB
- Stars: 30
- Watchers: 4
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# About
[![GoDoc](https://godoc.org/github.com/martinlindhe/google-geolocate?status.svg)](https://godoc.org/github.com/martinlindhe/google-geolocate)
Golang client for the Google Maps Geocode and Geolocation API:s
https://developers.google.com/maps/documentation/geolocation/intro
## Usage
```go
import geo "github.com/martinlindhe/google-geolocate"client := geo.NewGoogleGeo("api-key")
```## Geocode
```go
res, _ := client.Geocode("New York City")
fmt.Println(res)
// Output: &{40.7127837 -74.0059413 New York, NY, USA}
```## Reverse geocode
```go
p := geo.Point{Lat: 40.7127837, Lng: -74.0059413}
res, _ := client.ReverseGeocode(&p)
fmt.Println(res)
// Output: New York City Hall, New York, NY 10007, USA
```## Geolocate
```go
res, _ := client.Geolocate()
fmt.Println(res)
// Output: &{ 40.7127837 -74.0059413}
```### License
Under [MIT](LICENSE)
Parts of the code was based on [golang-geo](https://github.com/kellydunn/golang-geo)