| layer_icon | R Documentation |
Use the ggsvg::geom_point_svg() function to plot icons using the centroids
from the input simple feature object to set the icon location.
layer_icon( data = NULL, iconname_col = "icon", icon = NULL, px = NULL, source = NULL, svg = NULL, color = "black", crs = NULL, ... ) geom_sf_icon( data = NULL, iconname_col = "icon", icon = NULL, px = NULL, source = NULL, svg = NULL, color = "black", crs = NULL, ... )
data |
A |
iconname_col |
The column name in the input data to use as the icon
name. If the name matches multiple icons, the first match from |
icon |
Icon name. Default |
px |
Icon size in pixels. See |
source |
Icon source. See |
svg |
Optional. Custom file path or URL with SVG to pass to |
color |
SVG color passed to |
crs |
Coordinate reference system; defaults to |
... |
Additional parameters to |
ggsvg::geom_point_svg()
map_icons
Other layer:
layer_frame(),
layer_location_data(),
layer_markers(),
layer_mask(),
layer_neatline(),
layer_scaled()
nc <- read_sf_path(system.file("shape/nc.shp", package = "sf"))
basemap <-
ggplot2::ggplot() +
ggplot2::theme_void() +
layer_location_data(data = nc)
basemap +
geom_sf_icon(data = nc, icon = "point-start", size = 10)
nc$icon <- rep(c("1", "2", "3", "4"), nrow(nc) / 4)
basemap +
geom_sf_icon(data = nc, size = 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.