マウスホイールのズームを有効にする方法は、地図を最初にクリックした後でなければなりません。Shiny:地図上をクリックした後にマウスホイールをズームできるようにする方法はありますか?
マップをクリックした後に地図をズームしたいと思う次のコードがあります。それを輝かせる方法がありますか?
library(shiny)
library(leaflet)
library(maps)
ui <- fluidPage(
leafletOutput("CountryMap", width = 1000, height = 500)
)
server <- function(input, output){
Country = map("world", fill = TRUE, plot = FALSE, regions="USA", exact=TRUE)
output$CountryMap <- renderLeaflet({
leaflet(Country) %>% addTiles() %>%
fitBounds(Country$range[1], Country$range[3], Country$range[2], Country$range[4])%>%
addPolygons(fillOpacity = 0.6, smoothFactor = 0.5, stroke = TRUE, weight = 1)
})
}
shinyApp(ui =ui, server = server)