Skip to content

albttx/go-mapfit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoDoc CircleCI

Mapfit Golang client (non-official)

Mapfit REST APIS

Exemple

mapfitClient := mapfit.NewClient("mapfit-secret-token")
srcAddr := mapfit.Address{
    StreetAddress: "avenue des Champs Elysee",
    Locality:      "Paris",
}
dstAddr := mapfit.Address{
    StreetAddress: "Tour Eiffel",
    Locality:      "Paris",
}

// Directions API
directions, err := mapfitClient.GetDirections(srcAddr, dstAddr, "driving")
if err != nil {
    panic(err)
}
fmt.Printf("%#v\n", directions)

// Geocode API
geocode, err := mapfitClient.Geocode(srcAddr)
if err != nil {
    panic(err)
}
fmt.Printf("%#v\n", geocode)