Skip to contents

Use these in Shiny apps to display a Street View widget.

Usage

streetviewOutput(outputId, width = "100%", height = "400px")

renderStreetview(expr, env = parent.frame(), quoted = FALSE)

Arguments

outputId

Output variable name.

width, height

Element dimensions.

expr

An expression that generates a streetview() widget.

env

The environment in which to evaluate expr.

quoted

Is expr a quoted expression?

Value

streetviewOutput() returns a Shiny output element (an htmltools::tagList()) to place in a UI definition. renderStreetview() returns a Shiny render function to assign to an output slot in a server function.

Examples

if (requireNamespace("shiny", quietly = TRUE)) {
  ui <- shiny::fluidPage(streetviewOutput("pano"))

  server <- function(input, output) {
    output$pano <- renderStreetview({
      streetview(lat = 48.8584, lng = 2.2945, api_key = "YOUR_KEY")
    })
  }
  # shiny::shinyApp(ui, server)
}