File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ type TableRequest struct {
55 Profile string
66 Coordinates Geometry
77 Sources , Destinations []int
8+ Annotations []string
89}
910
1011// TableResponse resresents a response from the table method
@@ -21,6 +22,9 @@ func (r TableRequest) request() *request {
2122 if len (r .Destinations ) > 0 {
2223 opts .addInt ("destinations" , r .Destinations ... )
2324 }
25+ if len (r .Annotations ) > 0 {
26+ opts .add ("annotations" , r .Annotations ... )
27+ }
2428
2529 return & request {
2630 profile : r .Profile ,
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ func TestNotEmptyTableRequestOptions(t *testing.T) {
1515 req := TableRequest {
1616 Sources : []int {0 , 1 , 2 },
1717 Destinations : []int {1 , 3 },
18+ Annotations : []string {AnnotationsDuration .String (), AnnotationsDistance .String ()},
1819 }
19- assert .Equal (t , "destinations=1;3&sources=0;1;2" , req .request ().options .encode ())
20+ assert .Equal (t , "annotations=duration;distance& destinations=1;3&sources=0;1;2" , req .request ().options .encode ())
2021}
You can’t perform that action at this time.
0 commit comments