Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

martinlindhe/google-geolocate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

GoDoc

Golang client for the Google Maps Geocode and Geolocation API:s

https://developers.google.com/maps/documentation/geolocation/intro

Usage

import geo "github.com/martinlindhe/google-geolocate"

client := geo.NewGoogleGeo("api-key")

Geocode

res, _ := client.Geocode("New York City")
fmt.Println(res)
// Output: &{40.7127837 -74.0059413 New York, NY, USA}

Reverse geocode

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

res, _ := client.Geolocate()
fmt.Println(res)
// Output: &{ 40.7127837 -74.0059413}

License

Under MIT

Parts of the code was based on golang-geo

About

Golang client for the Google Maps Geolocation API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages