Add GeoJSON to a GeoLibre map
Usage
add_geojson(
map,
data,
name = "GeoJSON",
style = list(),
visible = TRUE,
opacity = 1,
...
)Arguments
- map
A GeoLibre widget.
- data
GeoJSON as a parsed list (a
FeatureCollection,Feature, or bare geometry), a JSON string, a file path, an HTTP(S) URL, or ansfobject. A URL or file is read and inlined into the project, up to a 50 MB limit; for larger datasets preferadd_vector(), which lets the browser stream the source.- name
Layer name.
- style
Named list of GeoLibre style overrides such as
fillColor,strokeColor, andstrokeWidth.- visible
Whether the layer is initially visible.
- opacity
Layer opacity from zero to one.
- ...
Additional style overrides given as named arguments, merged into
style.add_geojson(map, data, fillColor = "red")andadd_geojson(map, data, style = list(fillColor = "red"))are equivalent.