1
0
Fork 0
mirror of https://github.com/imjasonh/staticmaps synced 2026-07-08 19:05:09 +00:00

Add doc comments for Street View API methods

This commit is contained in:
Jason Hall 2014-10-13 14:40:37 -04:00
parent 556c8364df
commit 60f572450a

View file

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