View source: R/geojson_layer.R
geojson_layer | R Documentation |
Add a GeoJSON layer to a d3-carto-map.
geojson_layer(carto, data, file = NULL, label = "GeoJSON", clickable = FALSE, fill = "lightblue", stroke = "black", opacity = 0.5, visible = TRUE)
carto |
The map created by |
data |
A GeoJSON string (unparsed). The GeoJSON can be provided
through the |
file |
The path to a GeoJSON file. |
label |
The label for this layer on the layer selector. |
clickable |
Controls whether a point can be clicked to show the properties in the data frame. |
fill |
The fill color of the GeoJSON polygons, either as a name
recognized by a browser or as a hexadecimal string (e.g., |
stroke |
The stroke color of the GeoJSON polygons. |
opacity |
The opacity of the GeoJSON polygons. |
visible |
Should the layer be initially visible? |
# Path to a sample GeoJSON file land <- system.file("extdata", "land.geojson", package = "cartographer") cartographer() %>% geojson_layer(file = land, label = "Land")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.