Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(leaflet)
- library(shiny)
- # set basic ui
- ui <- fluidPage(
- leafletOutput("map")
- )
- server <- shinyServer(function(input, output) {
- # produce the basic leaflet map with single marker
- output$map <- renderLeaflet(
- leaflet() %>%
- addProviderTiles("CartoDB.Positron") %>%
- addCircleMarkers(lat = 54.406486, lng = -2.925284)
- )
- # observe the marker click info and print to console when it is changed.
- observeEvent(input$map_marker_click,
- print(input$map_marker_click)
- )
- })
- shinyApp(ui, server)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement