| basemap_style | R Documentation |
Creates a minimal map style with only a solid background color (or pattern) and no basemap tiles. Useful when you want to display data layers without any underlying map features.
basemap_style(color = "white", pattern = NULL)
color |
Character string. The background color. Default |
pattern |
Character string or |
A list representing a minimal map style, suitable for passing to
the style parameter of maplibre() or mapboxgl().
## Not run:
library(mapgl)
# Solid color background
maplibre(style = basemap_style("lightgrey")) |>
add_fill_layer(
id = "data",
source = my_sf_data,
fill_color = "steelblue"
)
# Background pattern (image must be loaded with add_image())
maplibre(style = basemap_style(pattern = "parchment")) |>
add_image("parchment", "parchment.jpg") |>
add_line_layer(
id = "borders",
source = my_sf_data,
line_color = "#2c1810"
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.