# NOT RUN {
## download and display an image
# key <- "your_api_key"
google_streetview(location = c(-37.817714, 144.96726),
size = c(400,400), output = "plot",
key = key)
## no response check - display 'sorry' message
google_streetview(location = c(-37.8, 144),
size = c(400,400),
panorama_id = NULL,
output = "plot",
heading = 90,
fov = 90,
pitch = 0,
response_check = FALSE,
key = key)
## embed an image of Flinders Street Station into a Shiny webpage
library(shiny)
library(googleway)
ui <- fluidPage(
uiOutput(outputId = "myStreetview")
)
server <- function(input, output){
key <- "your_api_key"
output$myStreetview <- renderUI({
tags$img(src = google_streetview(location = c(-37.817714, 144.96726),
size = c(400,400), output = "html",
key = key), width = "400px", height = "400px")
})
}
shinyApp(ui, server)
# }
Run the code above in your browser using DataLab