leafletOutput | R Documentation |
Use leafletOutput()
to create a UI element, and renderLeaflet()
to render the map widget.
leafletOutput(outputId, width = "100%", height = 400)
renderLeaflet(expr, env = parent.frame(), quoted = FALSE)
outputId |
output variable to read from |
width , height |
the width and height of the map (see
|
expr |
An expression that generates an HTML widget (or a promise of an HTML widget). |
env |
The environment in which to evaluate |
quoted |
Is |
# !formatR
library(shiny)
app <- shinyApp(
ui = fluidPage(leafletOutput('myMap')),
server = function(input, output) {
map = leaflet() %>% addTiles() %>% setView(-93.65, 42.0285, zoom = 17)
output$myMap = renderLeaflet(map)
}
)
if (interactive()) app
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.