Builds a point layer with the cluster renderer enabled, so nearby points collapse into count bubbles that split apart as the map zooms in.
Usage
add_marker_cluster(
map,
points,
name = "Marker Cluster",
cluster_radius = 50,
cluster_max_zoom = 14,
style = list(),
visible = TRUE,
opacity = 1,
...
)Arguments
- map
A GeoLibre widget.
- points
Points as a two-column matrix or a data frame of coordinates, a list of
c(longitude, latitude)pairs or namedlist(lng = , lat = , ...)entries, a point GeoJSON source, or ansfobject of points.- name
Layer name.
- cluster_radius
Cluster radius in pixels.
- cluster_max_zoom
Zoom level beyond which points are no longer clustered.
- 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.