Description Usage Arguments Details Value Examples
View source: R/raster_leaflet.R
Create a leaflet interactive map using a model output Raster\* object.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
raster |
A Raster\* object. |
index |
And index into the Raster\* object. See details. |
palette |
Color palette used to map cell values. This must be either
|
breaks |
The breaks used to map cell values to colors. CURRENTLY UNUSED |
direction |
Numeric. |
opacity |
Opacity of raster layer. |
maptype |
Name of leaflet ProviderTiles to use. |
title |
(Optional) A plot title. CURRENTLY UNUSED |
timezone |
Olson timezone in which times will be displayed. |
compare |
Optional comparison Raster\* object. |
index2 |
Index of the comparison Raster\* object. |
The index
is associated with the z axis or time-axis of
RasterBrick
object, e.g index = 1
is the first hour of a model.
The maptype
argument is mapped onto leaflet "ProviderTile" names.
Current mappings include:
"roadmap" – "OpenStreetMap"
"satellite" – "Esri.WorldImagery"
"terrain" – "Esri.WorldTopoMap"
"toner" – "Stamen.Toner"
If a character string not listed above is provided, it will be used as the underlying map tile if available. See https://leaflet-extras.github.io/leaflet-providers/ for a list of "provider tiles" to use as the background map.
A leaflet map.
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 | ## Not run:
library(AirFireModeling)
setModelDataDir('~/Data/BlueSky')
# Load consecutive model runs
rasterList <- raster_load(
modelName = "PNW-4km",
modelRun = c(2020091300, 2020091400),
xlim = c(-125, -117),
ylim = c(42, 47)
)
# Create a leaflet map
raster_leaflet(
raster = rasterList[[1]],
index = 3,
palette = "aqi",
direction = 1
)
# Create a leaflet map comparing two times from the same run
raster_leaflet(
raster = rasterList[[1]],
index = 12,
compare = rasterList[[1]],
index2 = 36,
timezone = "America/Los_Angeles"
)
# Create a leaflet map comparing the same time from two different runs
# Load consecutive model runs
rasterList <- raster_load(
modelName = c("PNW-4km", "PNW-1.33km"),
modelRun = 2020091300,
xlim = c(-125, -117),
ylim = c(42, 47)
)
raster_leaflet(
raster = rasterList[[1]],
index = 12,
compare = rasterList[[2]],
index2 = 12,
timezone = "America/Los_Angeles",
opacity = 0.3
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.