add_heatmap_layer {deckgl}R Documentation

Add a heatmap layer to the deckgl widget

Description

The HeatmapLayer can be used to visualize spatial distribution of data. It internally implements Gaussian Kernel Density Estimation to render heatmaps.

Usage

add_heatmap_layer(
  deckgl,
  id = "heatmap-layer",
  data = NULL,
  properties = list(),
  ...
)

Arguments

deckgl

A deckgl widget object.

id

The unique id of the layer.

data

The url to fetch data from or a data object.

properties

A named list of properties with names corresponding to the properties defined in the deckgl-api-reference for the given layer class. The properties parameter can also be an empty list. In this case all props must be passed as named arguments.

...

Named arguments that will be added to the properties object. Identical parameters are overwritten.

See Also

https://deck.gl/#/documentation/deckgl-api-reference/layers/heatmap-layer

Examples

## @knitr heatmap-layer
data("sf_bike_parking")

map <- deckgl() %>%
  add_heatmap_layer(
    data = sf_bike_parking,
    getPosition = ~lng + lat,
    getWeight = ~spaces
  ) %>%
  add_basemap()

if (interactive()) map

[Package deckgl version 0.3.0 Index]