From 60f572450a647040c7e383575db5168f9f0e01e7 Mon Sep 17 00:00:00 2001 From: Jason Hall Date: Mon, 13 Oct 2014 14:40:37 -0400 Subject: [PATCH] Add doc comments for Street View API methods --- streetview.go | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/streetview.go b/streetview.go index 90bb1b8..ee63bbc 100644 --- a/streetview.go +++ b/streetview.go @@ -7,6 +7,7 @@ import ( "net/url" ) +// StreetView requests a static StreetView image of the requested size. func (c Client) StreetView(s Size, opts *StreetViewOpts) (io.ReadCloser, error) { resp, err := c.do(baseURL + streetview(s, opts)) if err != nil { @@ -25,12 +26,30 @@ func streetview(s Size, opts *StreetViewOpts) string { return "streetview?" + p.Encode() } +// StreetViewOpts defines options for StreetView requests. type StreetViewOpts struct { + // Location specifies the location where the image should be snapped from. Location Location - Pano string // panoramio ID - Heading *float64 // 0-360 - FOV *float64 // 0-120, 90 default - Pitch float64 // -90 to +90 + + // Pano specifies a specific Panoramio ID. + Pano string + + // Heading specifies the compass heading (between 0 and 360) of the camera. + // + // Both 0 and 360 indicate North, 90 indicates East, 180 indicates South, and so on. + // + // If no heading is specified, a value will be calculated that directs the camera towards the specified Location, from a point at which the closest photograph was taken. + Heading *float64 + + // FOV specifies the field of view of the image. + // + // Accepted values are between 0 and 120, and if no value is given, a field of view of 90 degrees will be used. + FOV *float64 + + // Pitch specifies the up or down angle of the camera relative to the Street View vehicle. + // + // This is often, but not always, flat horizontal. Positive values angle the camera up (90 degrees indicating straight up); negative values angle the camera down (-90 indicates straight down). + Pitch float64 } func (s *StreetViewOpts) update(p url.Values) {