Skip to contents

Convenience wrapper around sv_static_url() that always returns an HTML <img> tag.

Usage

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

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.

...

Additional attributes passed to the <img> tag (e.g. style = "border-radius:8px").

Value

An HTML <img> tag (class "shiny.tag").

Examples

if (FALSE) { # \dontrun{
sv_static_img(48.8584, 2.2945)
} # }