Add a Hexbin layer
Create dynamic hexbin-based heatmaps on Leaflet maps. This plugin leverages the data-binding power of d3 to allow you to dynamically update the data and visualize the transitions.
addHexbin( map, lng = NULL, lat = NULL, radius = 20, layerId = NULL, group = NULL, opacity = 0.5, options = hexbinOptions(), data = getMapData(map) )
map |
a map widget object created from |
lng |
a numeric vector of longitudes, or a one-sided formula of the form
|
lat |
a vector of latitudes or a formula (similar to the |
radius |
Radius of the hexbin layer |
layerId |
the layer id |
group |
the name of the group the newly created layers should belong to
(for |
opacity |
Opacity of the hexbin layer |
options |
List of further options. See |
data |
the data object from which the argument values are derived; by
default, it is the |
the new map
object
Currently doesn't respect layerId
nor group
.
Other Hexbin-D3 Functions:
clearHexbin()
,
hexbinOptions()
,
hideHexbin()
,
showHexbin()
,
updateHexbin()
library(leaflet) library(leaflet.extras2) n <- 1000 df <- data.frame(lat = rnorm(n, 42.0285, .01), lng = rnorm(n, -93.65, .01)) leaflet() %>% addTiles() %>% addHexbin(lng = df$lng, lat = df$lat, options = hexbinOptions( colorRange = c("red", "yellow", "blue"), radiusRange = c(10, 20) ))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.