mirror of
https://github.com/imjasonh/staticmaps
synced 2026-07-21 22:57:03 +00:00
Thread through context.Context, currently unused
This commit is contained in:
parent
e2fe08ba0b
commit
9166c9bae7
9 changed files with 58 additions and 36 deletions
|
|
@ -5,6 +5,8 @@ import (
|
|||
"net/url"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"code.google.com/p/go.net/context"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
@ -35,9 +37,9 @@ const (
|
|||
// Directions requests routes between orig and dest Locations.
|
||||
//
|
||||
// See https://developers.google.com/maps/documentation/directions/
|
||||
func (c Client) Directions(orig, dest Location, opts *DirectionsOpts) ([]Route, error) {
|
||||
func (c Client) Directions(ctx context.Context, orig, dest Location, opts *DirectionsOpts) ([]Route, error) {
|
||||
var d directionsResponse
|
||||
if err := c.doDecode(baseURL+directions(orig, dest, opts), &d); err != nil {
|
||||
if err := c.doDecode(ctx, baseURL+directions(orig, dest, opts), &d); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if d.Status != StatusOK {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue