get_ggmap_from_df: Get a map for a given 'act_tbl'

View source: R/map.R

get_ggmap_from_dfR Documentation

Get a map for a given act_tbl

Description

get_ggmap_from_df takes an act_tbl object, computes the correct zoom and center for that activity, then returns a ggmap object for that zoom and center.

Usage

get_ggmap_from_df(df, ...)

Arguments

df

An act_tbl object.

...

Additional arguments forwarded to ggmap::get_googlemap().

Details

Note that since this calls ggmap::get_googlemap(), you must have previously called ggmap::register_google() to register an API key.

Value

A ggmap object, the result of calling ggmap::get_googlemap(), with the correct center and size to include the entire activity represented by the act_tbl.

See Also

ggmap::get_googlemap()

Examples

## Not run: 
example_gpx_file <- system.file(
  "extdata",
  "running_example.gpx.gz",
  package = "activatr"
)
act_tbl <- parse_gpx(example_gpx_file)
ggmap::ggmap(get_ggmap_from_df(act_tbl))

## End(Not run)

dschafer/activatr documentation built on July 29, 2024, 3:18 a.m.