diff --git a/geau/R/map_so_ii.r b/geau/R/map_so_ii.r index df6a9a27eb8b19abec0303a63ae8bd2f15932ce3..cb3eed2037573bece98175fbebfdbdfa1558a21b 100644 --- a/geau/R/map_so_ii.r +++ b/geau/R/map_so_ii.r @@ -20,7 +20,7 @@ #' # To be added (soon) #' } -map_so_ii = function(dataset, dataset_legend = NULL, theme = "clc", bar = TRUE, path = NULL, ...) { +map_so_ii = function(dataset, dataset_legend = NULL, theme = c("clc", "gaspar"), bar = TRUE, path = NULL, gaspar_year, ...) { if (!is.null(path)) { switch( @@ -45,6 +45,23 @@ map_so_ii = function(dataset, dataset_legend = NULL, theme = "clc", bar = TRUE, ) } + if ("gaspar" %in% theme) { + if (!missing(gaspar_year)) { + border = "grey80" + color = ifelse(geau::so_ii_gaspar[ , gaspar_year] > 0, scales::alpha("grey80", .5), NA) + } else { + border = NA + color = NA + } + + plot( + geau::so_ii_commune[["geometry"]], + border = border, + col = color, + add = TRUE + ) + } + plot(dataset[["geometry"]], add = TRUE, ...) if (bar == TRUE) { @@ -62,4 +79,4 @@ map_so_ii = function(dataset, dataset_legend = NULL, theme = "clc", bar = TRUE, } if (!is.null(path)) invisible(grDevices::dev.off()) -} \ No newline at end of file +}