|
|
@@ -222,20 +222,6 @@ server <- function(input, output, session) |
|
|
|
addPolygons(weight = 1, color = "#222222", opacity = .1, fillOpacity = .3, fillColor = ~pal(n)) %>% |
|
|
|
addLegend(position = "topleft", pal = pal, values = ~n) |
|
|
|
}) |
|
|
|
|
|
|
|
# Use a separate observer to recreate the legend as needed. |
|
|
|
# observe({ |
|
|
|
# Remove any existing legend, and only if the legend is |
|
|
|
# enabled, create a new one. |
|
|
|
# leafletProxy("map", data = quakes) %>% |
|
|
|
# clearControls() |
|
|
|
# if (input$legend) { |
|
|
|
# pal <- colorpal() |
|
|
|
# proxy %>% addLegend(position = "bottomright", |
|
|
|
# pal = pal, values = ~mag |
|
|
|
# ) |
|
|
|
# } |
|
|
|
# }) |
|
|
|
} |
|
|
|
|
|
|
|
shinyApp(ui = ui, server = server) |