mapsf
mapsf copied to clipboard
Enrich mf_background() with css like features
mf_background() adds background images underneath maps:
library(mapsf)
#> Le chargement a nécessité le package : sf
#> Linking to GEOS 3.7.1, GDAL 3.1.2, PROJ 7.1.0
mtq <- mf_get_mtq()
th <- mf_theme("default", bg = "grey20", fg = "grey80")
mf_init(mtq, theme = th)
mf_background(system.file("img/background.jpg", package = "mapsf"))
mf_map(mtq, lwd = 2, col = NA, border = "grey80", add = TRUE)
mf_title("A map with a nice background")
Created on 2021-06-18 by the reprex package (v2.0.0)
For now the image is stretched to fill the map space. I think it could be nice to mimic some CSS background features in this function. See https://www.w3schools.com/cssref/css3_pr_background-size.asp and https://www.w3schools.com/cssref/pr_background-repeat.asp.
The idea is to add some of these features to the function:
mf_background(filename = "xxx.png", size = "cover", repeat = FALSE)
Feel free to get in touch if you want to contribute.
I would like to work on this Can you assign me this
Yes, sure! Thank you.