mirror of
https://github.com/imjasonh/staticmaps
synced 2026-07-17 06:21:45 +00:00
Add DistanceMatrix API
This commit is contained in:
parent
c986c5df38
commit
2caece1694
3 changed files with 84 additions and 0 deletions
17
maps_test.go
17
maps_test.go
|
|
@ -159,3 +159,20 @@ func TestGeocode(t *testing.T) {
|
|||
}
|
||||
t.Logf("%v", r)
|
||||
}
|
||||
|
||||
func TestDistanceMatrix(t *testing.T) {
|
||||
c := NewClient("")
|
||||
orig := []Location{Address("Vancouver, BC"), Address("Seattle")}
|
||||
dst := []Location{Address("San Francisco"), Address("Victoria, BC")}
|
||||
opts := &DistanceMatrixOpts{
|
||||
Mode: String(ModeBicycling),
|
||||
Language: "fr-FR",
|
||||
}
|
||||
t.Logf("%s", baseURL+distancematrix(orig, dst, opts))
|
||||
r, err := c.DistanceMatrix(orig, dst, opts)
|
||||
if err != nil {
|
||||
t.Errorf("unexpected error: %v", err)
|
||||
}
|
||||
t.Logf("%v", r)
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue