Skip to contents

Returns the URL for a static Street View image. Useful for thumbnails, reports, or offline contexts where the interactive widget is not needed.

Usage

sv_static_url(
  lat,
  lng,
  api_key = Sys.getenv("GOOGLE_MAPS_API_KEY"),
  size = "640x400",
  heading = 0,
  pitch = 0,
  fov = 90,
  radius = 50,
  return_tag = FALSE
)

Arguments

lat

Numeric. Latitude.

lng

Numeric. Longitude.

api_key

Character. Google Maps API key. Defaults to GOOGLE_MAPS_API_KEY environment variable.

size

Character. Image dimensions as "WIDTHxHEIGHT". Max "640x640" on the free tier. Default: "640x400".

heading

Numeric. Camera heading in degrees (0-360). Default: 0.

pitch

Numeric. Camera pitch in degrees (-90 to 90). Default: 0.

fov

Numeric. Field of view in degrees (0-120). Default: 90.

radius

Numeric. Search radius in metres to find a panorama near lat/lng. Default: 50.

return_tag

Logical. If TRUE, return an HTML <img> tag instead of a bare URL string. Default: FALSE.

Value

A character URL string, or an HTML <img> tag (class "shiny.tag") when return_tag = TRUE.

Examples

if (FALSE) { # \dontrun{
url <- sv_static_url(48.8584, 2.2945)
browseURL(url)
} # }