Commit 5f18786b authored by vbaudrot's avatar vbaudrot

update app Immunity

parent 8d06fecd
......@@ -90,12 +90,12 @@ labelText = function(x,y,z){
# library(sf)
# library(dplyr)
# mapFranceDepartement = sf::st_read("../immunity/departements-20140306-100m.shp",
# stringsAsFactors = FALSE,
# options = "ENCODING=WINDOWS-1252")
# stringsAsFactors = FALSE)
#
# mapFranceDepartement_Metropolitan = mapFranceDepartement %>%
# dplyr::filter(!(nom %in% c("Martinique", "Guadeloupe", "La Réunion", "Guyane", "Mayotte", "Corse-du-Sud", "Haute-Corse")))
#
# dplyr::filter(!(code_insee %in% c("971", "972", "973", "974", "976", "2A", "2B")))
# mapFranceDepartement = mapFranceDepartement_Metropolitan
#
# mapFranceDepartement_Corse = sf::st_union(dplyr::filter(mapFranceDepartement, nom == "Corse-du-Sud"),
# dplyr::filter(mapFranceDepartement, nom == "Haute-Corse"))
# write_rds(mapFranceDepartement, "www/mapFranceDepartement.rds")
......
......@@ -313,22 +313,27 @@ server <- function(input, output, session){
addLegend(position = "bottomright",
title = "Rate immunity",
pal = palImmunity(),
values = ~ unlist(immun_M3_k)) %>%
leaflet::addPolygons()
values = ~ unlist(immun_M3_k)) # %>%
# leaflet::addPolygons()
})
#
# Use a separate observer to recreate polygons as needed.
# observe({
#
# proxyImmunity <- leafletProxy("mapImmunity", data = dataImmunity())
# colorpal = palImmunity()
#
# proxyImmunity %>%
# clearShapes() %>%
# leaflet::addPolygons( color = ~colorpal(Rt_immunity),
# fillOpacity = 0.5
# )
# })
observe({
proxyImmunity <- leafletProxy("mapImmunity", data = dataImmunity())
colorpal = palImmunity()
proxyImmunity %>%
clearShapes() %>%
leaflet::addPolygons( data = dataImmunity(),
# color = ~colorpal(Rt_immunity),
fillColor = ~colorpal(Rt_immunity),
weight = 2,
opacity = 1,
color = "white",
dashArray = "3",
fillOpacity = 0.7)
})
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment