Examples using Leaflet.heat in R with %>% approach but more specifically using addressPoints or similar
sildeag opened this issue · 1 comments
Any examples of Leaflet.heat code following this structure would be very helpful eg.
L2 = leaflet() %>% addTiles()
L2 = L2 %>% registerPlugin(leafletHeatPlugin)
L2 = L2 %>% setView(29.7632836, -95.3632715, 10)
L2 = L2 %>% addLayersControl(
baseGroups = names(esri),
options = layersControlOptions(collapsed = TRUE)
)
L2 = L2 %>% addAssets
L2 = L2 %>% addHeatmap(addressPoints)
L2 = L2 %>% add
the Leaflet.heat approaches that seem to sort of work use L2$ and yet many examples of Leaflet in R are given using %>%:
L2 <- Leaflet$new()
L2$setView(c(47.5982623,-122.3415519), zoom=10)
L2$tileLayer(provider="Acetate.terrain")
add heatmap plugin
L2$addAssets(jshead = c("http://leaflet.github.io/Leaflet.heat/dist/leaflet-heat.js"))
heatmap layer
L2$setTemplate(afterScript = sprintf("
<script>
var addressPoints = %s
var heat = L.heatLayer(addressPoints).addTo(map)
</script>
", j
))
following too