View source: R/network_networkMap.R
networkMap | R Documentation |
This function uses openair::importMeta()
to obtain metadata for measurement
sites and uses it to create an attractive leaflet
map. By default a map
will be created in which readers may toggle between a vector base map and a
satellite/aerial image, although users can further customise the control menu
using the provider
and control
parameters.
networkMap(
source = "aurn",
control = NULL,
year = NULL,
cluster = TRUE,
provider = c(Default = "OpenStreetMap", Satellite = "Esri.WorldImagery"),
legend = TRUE,
legend.position = "topright",
control.collapsed = FALSE,
control.position = "topright"
)
source |
One or more UK or European monitoring networks. default: One or more air quality networks for which data is available through openair. Available networks include:
There are two additional options provided for convenience:
|
control |
Option to create a 'layer control' menu. default: A string to specify categories in a "layer control" menu, to allow readers to select between different site categories. Choices include:
|
year |
A year, or range of years, with which to filter data. default: By default, |
cluster |
Cluster markers together when zoomed out? default: When |
provider |
The basemap(s) to be used. default: Any number of leaflet::providers. See
http://leaflet-extras.github.io/leaflet-providers/preview/ for a list of
all base maps that can be used. If multiple base maps are provided, they
can be toggled between using a "layer control" interface. By default, the
interface will use the provider names as labels, but users can define their
own using a named vector (e.g., |
legend |
Draw a shared legend? default: When multiple |
legend.position |
Position of the legend default: Where should the shared legend be placed? One of "topleft", "topright",
"bottomleft" or "bottomright". Passed to the |
control.collapsed |
Show the layer control as a collapsed? default: Should the "layer control" interface be collapsed? If |
control.position |
Position of the layer control menu default: Where should the "layer control" interface be placed? One of "topleft",
"topright", "bottomleft" or "bottomright". Passed to the |
When selecting multiple data sources using source
, please be mindful that
there can be overlap between the different networks. For example, an air
quality site in Scotland may be part of the AURN and the SAQN.
networkMap()
will only show one marker for such sites, and uses the order
in which source
arguments are provided as the hierarchy by which to assign
sites to networks. The aforementioned AURN & SAQN site will therefore have
its SAQN code displayed if source = c("saqn", "aurn")
, and its AURN code
displayed if source = c("aurn", "saqn")
.
This hierarchy is also reflected when control = "network"
is used. As
leaflet
markers cannot be part of multiple groups, the AURN & SAQN site
will be part of the "SAQN" layer control group when source = c("saqn", "aurn")
and the "AURN" layer control group when source = c("aurn", "saqn")
.
A leaflet object.
Other uk air quality network mapping functions:
searchNetwork()
## Not run:
# view one network, grouped by site type
networkMap(source = "aurn", control = "site_type")
# view multiple networks, grouped by network
networkMap(source = c("aurn", "waqn", "saqn"), control = "network")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.