Skip to content
jlhapp edited this page Sep 7, 2016 · 1 revision

Shiny allows the user to interact with the leaflet. To view detailed code, see the "Tornado_Shiny.R" (for points) and "Tornado_Shiny_Lines.R" (for polylines). Both examples use the bootstrapPage() but another common type of page is the fluidPage(). You can write a Shiny app either in two R scripts (named: ui.R and server.R) or in one app with the ui and server written in the script. Both examples use one script.

When using leaflet with shiny app, you need "leafletOutput" in the ui.R file and renderLeaflet() in the server.R file. Users will also need the leafletProxy() function to modify a map that's already running in a page. Another function you must have in Shiny is the reactive() function. This will update when the user changes the user interface. The "Tornado_Shiny.R" script will give you a user interface like this:

shiny_points

Clone this wiki locally