Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Codes ¶
type Codes string
Codes are direction response Codes https://www.mapbox.com/api-documentation/#matrix-errors
type DirectionMatrixResponse ¶
type DirectionMatrixResponse struct { Code string Durations [][]float64 Sources []Waypoint Destinations []Waypoint }
DirectionMatrixResponse is the response from GetDirections https://www.mapbox.com/api-documentation/#matrix-response-format
type DirectionsMatrix ¶
type DirectionsMatrix struct {
// contains filtered or unexported fields
}
DirectionsMatrix api wrapper instance
func NewDirectionsMatrix ¶
func NewDirectionsMatrix(base *base.Base) *DirectionsMatrix
NewDirectionsMatrix Create a new Directions Matrix API wrapper
func (*DirectionsMatrix) GetDirectionsMatrix ¶
func (d *DirectionsMatrix) GetDirectionsMatrix(locations []base.Location, profile RoutingProfile, opts *RequestOpts) (*DirectionMatrixResponse, error)
GetDirectionsMatrix between a set of locations using the specified routing profile
type RequestOpts ¶
type RequestOpts struct { Sources string `url:"sources,omitempty"` Destinations string `url:"destinations,omitempty"` }
RequestOpts request options for directions api
func (*RequestOpts) SetDestinations ¶
func (o *RequestOpts) SetDestinations(destinations []string)
SetDestinations The points which will act as the destinations.
func (*RequestOpts) SetSources ¶
func (o *RequestOpts) SetSources(sources []string)
SetSources The points which will act as the starting point.
type RoutingProfile ¶
type RoutingProfile string
RoutingProfile defines routing mode for direction matrix finding
const ( // RoutingDriving mode for for automovide routing RoutingDriving RoutingProfile = "mapbox/driving" // RoutingWalking mode for Pedestrian routing RoutingWalking RoutingProfile = "mapbox/walking" // RoutingCycling mode for bicycle routing RoutingCycling RoutingProfile = "mapbox/cycling" )
type Waypoint ¶
Waypoint is an input point snapped to the road network https://www.mapbox.com/api-documentation/#waypoint-object