View source: R/topojson_layer.R
topojson_layer | R Documentation |
Add a TopoJSON layer to a d3-carto-map.
topojson_layer(carto, data, file = NULL, feature, label = "TopoJSON", clickable = FALSE, fill = "lightblue", stroke = "black", opacity = 0.5, visible = TRUE)
carto |
The map created by |
data |
A TopoJSON string (unparsed). The topojson can be provided
through the |
file |
The path to a topojson file. |
feature |
The name of the feature object to be mapped. |
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 TopoJSON polygons, either as a name
recognized by a browser or as a hexadecimal string (e.g., |
stroke |
The stroke color of the TopoJSON polygons. |
opacity |
The opacity of the TopoJSON polygons. |
visible |
Should the layer be initially visible? |
# Path to a sample TopoJSON file us1853 <- system.file("extdata", "us1853.topojson", package = "cartographer") cartographer(region = "United States") %>% topojson_layer(file = us1853, feature = "us", label = "US 1853")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.