Skip to content

Commit

Permalink
Add AnnotationDurationDistance
Browse files Browse the repository at this point in the history
  • Loading branch information
NV4RE committed Oct 6, 2020
1 parent 9a197ea commit b2fa61d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
4 changes: 4 additions & 0 deletions table.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ type TableRequest struct {
Profile string
Coordinates Geometry
Sources, Destinations []int
Annotations Annotations
}

// TableResponse resresents a response from the table method
Expand All @@ -21,6 +22,9 @@ func (r TableRequest) request() *request {
if len(r.Destinations) > 0 {
opts.addInt("destinations", r.Destinations...)
}
if r.Annotations != "" {
opts.add("annotations", string(r.Annotations))
}

return &request{
profile: r.Profile,
Expand Down
17 changes: 9 additions & 8 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,15 @@ type Annotations string

// Supported annotations param values
const (
AnnotationsTrue Annotations = "true"
AnnotationsFalse Annotations = "false"
AnnotationsNodes Annotations = "nodes"
AnnotationsDistance Annotations = "distance"
AnnotationsDuration Annotations = "duration"
AnnotationsDatasources Annotations = "datasources"
AnnotationsWeight Annotations = "weight"
AnnotationsSpeed Annotations = "speed"
AnnotationsTrue Annotations = "true"
AnnotationsFalse Annotations = "false"
AnnotationsNodes Annotations = "nodes"
AnnotationsDistance Annotations = "distance"
AnnotationsDuration Annotations = "duration"
AnnotationDurationDistance Annotations = "duration,distance"
AnnotationsDatasources Annotations = "datasources"
AnnotationsWeight Annotations = "weight"
AnnotationsSpeed Annotations = "speed"
)

// String returns Annotations as a string
Expand Down

0 comments on commit b2fa61d

Please sign in to comment.