Here's what I tried
server <- function(input, output) {
observe({
output$mymap <- renderLeaflet({
leaflet() %>%
addTiles() %>%
fitBounds(-124.7666, 49.4000, -67.0583, 25.0666)%>%
setView(-95.91245, 37.2333, zoom = 3)
})
click = input$mymap_click
if(is.null(click))
return()
leafletProxy('mymap')%>%addMarkers(lng = click$lng,
lat = click$lat)%>%
setView(lng = click$lng,
lat = click$lat, zoom =7)
output$text <- renderText(paste(click$lng,click$lat))
})
}
ui <- fluidPage(textOutput("text"),
leafletOutput("mymap"))
shinyApp(ui = ui, server = server)
But instead of a reactive output text, I want something which is dynamic i.e., map should change with change in lat, lon value and vice versa
Here's a sample representation from https://psl.noaa.gov/eddi/