There is a very nice interface to google earth images available via ggmap
. For example:
ggmap::get_map(location = c(lon = -95.3632715, lat = 29.7632836),
maptype ="satellite",zoom=20)
will return a satellite map image from Google Maps/Earth. On Google Maps website if you zoom a bit more, it switches to streetview. Is there a similar way from R to get the streetview images?
There does seem to be an API, but can't find anything analogous to the ggmap
interface in R.
My googleway
package has a google map widget (and also works with Shiny).
You'll need a valid Google API key to use it
library(googleway)
key <- "your_api_key"
df <- data.frame(lat = -37.817714,
lon = 144.967260,
info = "Flinders Street Station")
google_map(key = key, height = 600, search_box = T) %>%
add_markers(data = df, info_window = "info")
## other available methods
# add_markers
# add_heatmap
# add_circles
# add_traffic
# add_bicycling
# add_transit
(notice the marker is still there)
There's also a google_streetview()
function that will download a static streetview image (using the Google Street View Static Image API)
google_streetview(location = c(-37.8177, 144.967),
size = c(400,400),
panorama_id = NULL,
output = "plot",
heading = 90,
fov = 90,
pitch = 0,
response_check = FALSE,
key = key)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With