Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/allanpk716/google-geolocate
fork from github.com/martinlindhe/google-geolocate
https://github.com/allanpk716/google-geolocate
Last synced: 22 days ago
JSON representation
fork from github.com/martinlindhe/google-geolocate
- Host: GitHub
- URL: https://github.com/allanpk716/google-geolocate
- Owner: allanpk716
- License: mit
- Created: 2021-04-21T01:44:40.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-04-21T01:52:19.000Z (over 3 years ago)
- Last Synced: 2023-08-27T09:04:37.441Z (about 1 year ago)
- Language: Go
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
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)
[![Travis-CI](https://api.travis-ci.org/martinlindhe/google-geolocate.svg)](https://travis-ci.org/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", "httpProxyUrl")
```## 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)