google_map-shiny.Rd
Output and render functions for using google_map within Shiny applications and interactive Rmd documents.
google_mapOutput(outputId, width = "100%", height = "400px") renderGoogle_map(expr, env = parent.frame(), quoted = FALSE)
outputId | output variable to read from |
---|---|
width, height | Must be a valid CSS unit (like |
expr | An expression that generates a google_map |
env | The environment in which to evaluate |
quoted | Is |
# NOT RUN { library(shiny) library(googleway) ui <- fluidPage(google_mapOutput("map")) server <- function(input, output, session){ api_key <- "your_api_key" output$map <- renderGoogle_map({ google_map(key = api_key) }) } shinyApp(ui, server) ## using split view library(shinydashboard) library(googleway) ui <- dashboardPage( dashboardHeader(), dashboardSidebar(), dashboardBody( box(width = 6, google_mapOutput(outputId = "map") ), box(width = 6, google_mapOutput(outputId = "pano") ) ) ) server <- function(input, output) { set_key("your_api_key") output$map <- renderGoogle_map({ google_map(location = c(-37.817386, 144.967463), zoom = 10, split_view = "pano") }) } shinyApp(ui, server) # }