Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. library(leaflet)
  2. library(shiny)
  3.  
  4. # set basic ui
  5. ui <- fluidPage(
  6. leafletOutput("map")
  7. )
  8.  
  9. server <- shinyServer(function(input, output) {
  10.  
  11. # produce the basic leaflet map with single marker
  12. output$map <- renderLeaflet(
  13. leaflet() %>%
  14. addProviderTiles("CartoDB.Positron") %>%
  15. addCircleMarkers(lat = 54.406486, lng = -2.925284)
  16.  
  17. )
  18.  
  19. # observe the marker click info and print to console when it is changed.
  20. observeEvent(input$map_marker_click,
  21. print(input$map_marker_click)
  22. )
  23.  
  24. })
  25.  
  26.  
  27. shinyApp(ui, server)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement