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 = c("terrain", "satellite", "roadmap", "hybrid"),
language = "en-EN", region, markers, path, visible,
style, sensor = FALSE, messaging = FALSE,
urlonly = FALSE, filename = "ggmapTemp",
color = c("color", "bw"), ...)
ggmap
get_googlemap(urlonly = TRUE)
# get_googlemap has several argument checks
get_googlemap(zoom = 13.5)
get_googlemap(scale = 3)
get_googlemap(center = c(-30,-110))
# markers and paths are easy to access
d <- function(x=-95.36, y=29.76, n,r,a){
round(data.frame(
lon = jitter(rep(x,n), amount = a),
lat = jitter(rep(y,n), amount = a)
), digits = r)
}
df <- d(n=50,r=3,a=.3)
map <- get_googlemap(markers = df, path = df,, scale = 2)
ggmap(map)
ggmap(map, fullpage = TRUE) +
geom_point(aes(x = lon, y = lat), data = df, size = 3, colour = 'black') +
geom_path(aes(x = lon, y = lat), data = df)
gc <- geocode('waco, texas')
center <- as.numeric(gc)
ggmap(get_googlemap(center = center, color = 'bw', scale = 2), fullpage = T)
# the scale argument can be seen in the following
# (make your graphics device as large as possible)
ggmap(get_googlemap(center, scale = 1), fullpage = TRUE) # pixelated
ggmap(get_googlemap(center, scale = 2), fullpage = TRUE) # fine
Run the code above in your browser using DataLab