Description Usage Arguments Examples
Add a webgl heatmap
Adds a heatmap with data from a GeoJSON/TopoJSON file/url
Adds a heatmap with data from a KML file/url
Adds a heatmap with data from a CSV file/url
Adds a heatmap with data from a GPX file/url
removes the webgl heatmap
clears the webgl heatmap
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | addWebGLHeatmap(map, lng = NULL, lat = NULL, intensity = NULL,
layerId = NULL, group = NULL, size = "30000", units = "m",
opacity = 1, gradientTexture = NULL, alphaRange = 1,
data = leaflet::getMapData(map))
addWebGLGeoJSONHeatmap(map, geojson, layerId = NULL, group = NULL,
intensityProperty = NULL, size = "30000", units = "m", opacity = 1,
gradientTexture = NULL, alphaRange = 1)
addWebGLKMLHeatmap(map, kml, layerId = NULL, group = NULL,
intensityProperty = NULL, size = "30000", units = "m", opacity = 1,
gradientTexture = NULL, alphaRange = 1)
addWebGLCSVHeatmap(map, csv, csvParserOptions, layerId = NULL, group = NULL,
intensityProperty = NULL, size = "30000", units = "m", opacity = 1,
gradientTexture = NULL, alphaRange = 1)
addWebGLGPXHeatmap(map, gpx, layerId = NULL, group = NULL,
intensityProperty = NULL, size = "30000", units = "m", opacity = 1,
gradientTexture = NULL, alphaRange = 1)
removeWebGLHeatmap(map, layerId)
clearWebGLHeatmap(map)
|
map |
the map to add pulse Markers to. |
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 |
intensity |
intensity of the heat. A vector of numeric values or a formula. |
layerId |
the layer id |
group |
the name of the group the newly created layers should belong to
(for |
size |
in meters or pixels |
units |
either "m" or "px" |
opacity |
for the canvas element |
gradientTexture |
Alternative colors for heatmap. allowed values are "skyline", "deep-sea" |
alphaRange |
adjust transparency by changing to value between 0 and 1 |
data |
the data object from which the argument values are derived; by
default, it is the |
geojson |
The geojson or topojson url or contents as string. |
intensityProperty |
The property to use for determining the intensity at a point. Can be a "string" or a JS function, or NULL. |
kml |
The KML url or contents as string. |
csv |
The CSV url or contents as string. |
csvParserOptions |
options for parsing the CSV.
Use |
gpx |
The GPX url or contents as string. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | ## addWebGLHeatmap
leaflet(quakes) %>%
addProviderTiles(providers$CartoDB.DarkMatter) %>%
addWebGLHeatmap(lng = ~long, lat = ~lat, size = 60000)
## for more examples see
# browseURL(system.file("examples/webglHeatmaps.R", package = "leaflet.extras"))
## addWebGLGeoJSONHeatmap
geoJson <- readr::read_file(
"https://rawgit.com/benbalter/dc-maps/master/maps/historic-landmarks-points.geojson"
)
leaflet() %>%
setView(-77.0369, 38.9072, 12) %>%
addProviderTiles(providers$CartoDB.Positron) %>%
addWebGLGeoJSONHeatmap(
geoJson, size = 30 , units = "px"
) %>%
addGeoJSONv2(
geoJson,
markerType = "circleMarker",
stroke = FALSE, fillColor = "black", fillOpacity = 0.7,
markerOptions = markerOptions(radius = 2)
)
## for more examples see
# browseURL(system.file("examples/geojsonV2.R", package = "leaflet.extras"))
# browseURL(system.file("examples/TopoJSON.R", package = "leaflet.extras"))
## addWebGLKMLHeatmap
kml <- readr::read_file(
system.file("examples/data/kml/crimes.kml.zip", package = "leaflet.extras")
)
leaflet() %>% setView(-77.0369, 38.9072, 12) %>%
addProviderTiles(providers$CartoDB.Positron) %>%
addWebGLKMLHeatmap(kml, size = 20, units = "px") %>%
addKML(
kml,
markerType = "circleMarker",
stroke = FALSE, fillColor = "black", fillOpacity = 1,
markerOptions = markerOptions(radius = 1))
## addWebGLCSVHeatmap
csv <- readr::read_file(
system.file("examples/data/csv/world_airports.csv.zip", package = "leaflet.extras")
)
leaflet() %>%
setView(0, 0, 2) %>%
addProviderTiles(providers$CartoDB.DarkMatterNoLabels) %>%
addWebGLCSVHeatmap(
csv,
csvParserOptions("latitude_deg", "longitude_deg"),
size = 10, units = "px")
airports <- readr::read_file(
system.file("examples/data/gpx/md-airports.gpx.zip", package = "leaflet.extras")
)
leaflet() %>%
addBootstrapDependency() %>%
setView(-76.6413, 39.0458, 8) %>%
addProviderTiles(
providers$CartoDB.Positron,
options = providerTileOptions(detectRetina = TRUE)
) %>%
addWebGLGPXHeatmap(
airports,
size = 20000,
group = "airports",
opacity = 0.9
) %>%
addGPX(
airports,
markerType = "circleMarker",
stroke = FALSE, fillColor = "black", fillOpacity = 1,
markerOptions = markerOptions(radius = 1.5),
group = "airports"
)
## for a larger example see
# browseURL(system.file("examples/GPX.R", package = "leaflet.extras"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.