map: A map object created by the mapboxgl function.
id: A unique ID for the layer.
source: The ID of the source, alternatively an sf object (which will be converted to a GeoJSON source) or a named list that specifies type and url for a remote source.
source_layer: The source layer (for vector sources).
heatmap_color: The color of the heatmap points.
heatmap_intensity: The intensity of the heatmap points.
heatmap_opacity: The opacity of the heatmap layer.
heatmap_radius: The radius of influence of each individual heatmap point.
heatmap_weight: The weight of each individual heatmap point.
visibility: Whether this layer is displayed.
slot: An optional slot for layer order.
min_zoom: The minimum zoom level for the layer.
max_zoom: The maximum zoom level for the layer.
before_id: The name of the layer that this layer appears "before", allowing you to insert layers below other layers in your basemap (e.g. labels).
filter: An optional filter expression to subset features in the layer.
Returns
The modified map object with the new heatmap layer added.