get_googlemap()
queries the Google Maps Static API version 2 to download
a static map. Note that in most cases by using this function you are
agreeing to the Google Maps API Terms of Service at
https://cloud.google.com/maps-platform/terms/. Note that as of mid-2018,
registering with Google Cloud to obtain an API key is required to use any of
Google's services, including get_googlemap()
. Usage and billing may apply,
see the links under See Also further down in this documentation for more
details.
get_googlemap(
center = c(lon = -95.3632715, lat = 29.7632836),
zoom = 10,
size = c(640, 640),
scale = 2,
format = c("png8", "gif", "jpg", "jpg-baseline", "png32"),
maptype = GOOGLE_VALID_MAP_TYPES,
language = "en-EN",
messaging = FALSE,
urlonly = FALSE,
filename = NULL,
color = c("color", "bw"),
force = FALSE,
where = tempdir(),
archiving = FALSE,
ext = "com",
inject = "",
region,
markers,
path,
visible,
style,
...
)
a ggmap object (a classed raster object with a bounding box attribute)
the center of the map; either a longitude/latitude numeric
vector or a string containing a location, in which case geocode()
is
called with source = "google"
. (default: c(lon = -95.3632715, lat = 29.7632836)
, a reference to Houston, Texas)
map zoom; an integer from 3 (continent) to 21 (building), default value 10 (city)
rectangular dimensions of map in pixels - horizontal x vertical - with a max of c(640, 640). this parameter is affected in a multiplicative way by scale.
multiplicative factor for the number of pixels returned possible values are 1, 2, or 4 (e.g. size = c(640,640) and scale = 2 returns an image with 1280x1280 pixels). 4 is reserved for google business users only. scale also affects the size of labels as well.
character string providing image format - png, jpeg, and gif formats available in various flavors
character string providing google map theme. options available
are "terrain"
, "satellite"
, "roadmap"
, and "hybrid"
character string providing language of map labels (for themes
with them) in the format "en-EN"
. not all languages are supported; for
those which aren't the default language is used
turn messaging on/off
return url only
destination file for download (file extension added according
to format). Default NULL
means a random tempfile()
.
color or black-and-white
if the map is on file, should a new map be looked up?
where should the file drawer be located (without terminating "/")
use archived maps. note: by changing to TRUE you agree to the one of the approved uses listed in the Google Maps API Terms of Service : https://cloud.google.com/maps-platform/terms/.
domain extension (e.g. "com"
, "co.nz"
)
character string to add to the url
borders to display as a region code specified as a two-character ccTLD ("top-level domain") value, see https://en.wikipedia.org/wiki/List_of_Internet_top-level_domains#Country_code_top-level_domains
data.frame with first column longitude, second column latitude, for which google markers should be embedded in the map image, or character string to be passed directly to api
data.frame (or list of data.frames) with first column longitude, second column latitude, for which a single path should be embedded in the map image, or character string to be passed directly to api
a location as a longitude/latitude numeric vector (or data frame with first column longitude, second latitude) or vector of character string addresses which should be visible in map extent
character string to be supplied directly to the api for the style argument or a named vector (see examples). this is a powerful complex specification, see https://developers.google.com/maps/documentation/maps-static/
...
David Kahle david@kahle.io
https://developers.google.com/maps/documentation/maps-static/overview/,
https://developers.google.com/maps/documentation/maps-static/start/,
https://developers.google.com/maps/documentation/maps-static/get-api-key/,
https://developers.google.com/maps/documentation/maps-static/usage-and-billing/,
ggmap()
, register_google()