Skip to content

Instantly share code, notes, and snippets.

@corynissen
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save corynissen/5a25be770275f3b15814 to your computer and use it in GitHub Desktop.
Save corynissen/5a25be770275f3b15814 to your computer and use it in GitHub Desktop.
leaflet shiny
library("leaflet")
server <- function(input, output) {
output$map <- renderLeaflet({
leaflet() %>%
setView(lat=41.88043, lng=-87.63609, zoom=18) %>%
addTiles()
})
observeEvent(input$map_click, {
p <- input$map_click
output$Click_text <- renderText(unlist(p))
})
}
ui <- fluidPage(
fluidRow(
leafletOutput("map")
),
fluidRow(
column(width = 3,
verbatimTextOutput("Click_text")
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment