1
0
Fork 0
mirror of https://github.com/imjasonh/staticmaps synced 2026-07-17 06:21:45 +00:00

Add DistanceMatrix API

This commit is contained in:
Jason Hall 2014-10-07 12:46:01 -04:00
parent c986c5df38
commit 2caece1694
3 changed files with 84 additions and 0 deletions

View file

@ -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)
}