Go client to consume Baato APIs easily.
// Import core APIs
import (
baato "github.com/baato/baato-go-client/lib"
geocode "github.com/baato/baato-go-client/lib/geocode"
)
// initialize Baato core module
accessToken := "YOUR BAATO ACCESS TOKEN HERE" // Get Baato token from environment
baatoMap := baato.Baato(accessToken)
- Geocoding (Search) API
- ReverseGeocoding (Reverse Search) API
- Nearby Features API
- Directions API
For a detailed usage instructions, please visit documentation for the Baato-Go-Client avaiable here. Quick usage examples are shown here.
// intialize geocoding request options
var geocodingRequest = geocode.GeocodeRequestOptions{
Q: "do",
Limit: 5,
}
geocode, _ := baatoMap.Geocode.GetGeocode(geocodingRequest)
fmt.Println(geocode.Data)
// intialize reverse geocoding request options
var reverseGeocodingRequest = reversegeocode.ReverseGeocodeRequestOptions{
Lat: 27.717728723291803,
Lon: 85.32784938812257,
}
reverseGeocode, _ := baatoMap.ReverseGeocode.GetReverseGeocode(reverseGeocodingRequest)
fmt.Println(reverseGeocode.Data)
You can use this API to get nearby places around a point that is interesting for you. For a complete list of supported type of places, please see the docs.
// intialize nearby places request options
var nearbyPlacesRequest = nearby.NearbyPlacesRequestOptions{
Type: "eat",
Lat: 27.717728723291803,
Lon: 85.32784938812257,
}
nearbyplaces, _ := baatoMap.NearbyPlaces.GetNearbyPlaces(nearbyPlacesRequest)
fmt.Println(nearbyplaces.Data)
// intialize directions request options. PointsArray represents points that we should pass through.
directionsRequest := directions.DirectionsRequestOptions{
PointsArray: []string{"27.6733433,85.2763307", "27.67444444,85.28047222"},
Mode: "bike",
}
directions, _ := baatoMap.Directions.GetDirections(directionsRequest)
fmt.Println(directions.Data)
You can contribute in many ways (development, issue/bug reporting, feature request, etc.)