Created
November 9, 2025 15:45
-
-
Save walkerke/648402074451eae4ad43c648b236f966 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(mapgl) | |
| library(sf) | |
| nc <- st_read(system.file("shape/nc.shp", package = "sf")) | |
| # Custom style with background-pattern | |
| style <- list( | |
| version = 8, | |
| sources = structure(list(), .Names = character(0)), | |
| layers = list( | |
| list( | |
| id = "background", | |
| type = "background", | |
| paint = list( | |
| `background-pattern` = "parchment" | |
| ) | |
| ) | |
| ) | |
| ) | |
| maplibre(style = style) |> | |
| fit_bounds(nc) |> | |
| add_image( | |
| id = "parchment", | |
| url = "parchment.jpg" # Your image - find a free stock photo online to try | |
| ) |> | |
| add_line_layer( | |
| id = "counties", | |
| source = nc, | |
| line_color = "#2c1810", | |
| line_width = 1.5 | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment