Closed SHIVAM2607 closed 6 months ago
This should be an issue in this package https://github.com/trafficonese/leaflet.extras
Can you give a minimal reproducible example?
This seems to work:
library(shiny)
library(leaflet)
library(leaflet.extras)
fName <- "https://rawgit.com/benbalter/dc-maps/master/maps/ward-2012.geojson"
geoJson <- jsonlite::fromJSON(readr::read_file(fName))
ui <- fluidPage(
actionButton("act", "addgeoson"),
leafletOutput("map")
)
server <- function(input, output, session) {
output$map <- renderLeaflet({
leaflet() %>%
addTiles() %>%
setView(-77.0369, 38.9072, 11)
})
observeEvent(input$act, {
leafletProxy("map") %>%
addGeoJSONv2(
jsonlite::toJSON(geoJson), weight = 1, fillOpacity = 0.6)
})
}
shinyApp(ui, server)
hi
I want to update my geojson in my app but addgeojsonv2 function is not working with leafletproxy, please suggest