openairmaps 0.11.0
Breaking changes
-
Several deprecated functions and arguments have been removed:
trajMapStatic()andtrajLevelMapStatic(). Useopenair::trajPlot()andopenair::trajLevel()instead.searchNetwork(), which is superseded bynetworkMap()(see below).The
controlargument of thepolarMap()family andtrajMap(), and thefacetargument frompolarMapStatic(). Usetypeinstead; thepolarMap()family now errors with a pointer totypeif either is used.controlinnetworkMap()is unaffected.
trajMap()andtrajLevelMap()now takelatitudebeforelongitude. Both default toNULLand are guessed fromdata, in line with the rest of the package.trajMap()now usescols = "turbo"by default, in line with the rest of the package. It also now errors ifcolouris neither a column ofdatanor a valid colour (e.g., a misspelled column name), rather than passing it on to leaflet.The default
vgminkrigingMap()now has arangeof 50 rather than 50,000. As the data are in latitude and longitude, gstat measures this in kilometres, so the previous default was far larger than intended.“Layer control” menus now list
typelevels in the order of their factor levels (e.g., “Monday” before “Tuesday”), and multiple pollutants in the order they were given, rather than the order they first appear in the data.buildPopup()now only appliesquickTextHTML()to its labels, not its values, as these are the user’s data (e.g., a value of “No” was previously shown as “NO”).polar_datanow includes the site code, and its columns have been reordered to better matchopenair::importUKAQ().
New features
New functions
pointMap()summarises pollutant data at each site (e.g., the mean concentration) and shows it as coloured circles on a dynamic or static map. It shares its arguments withkrigingMap()andvoronoiMap(), but draws no interpolated surface.addTrajLevel()adds gridded trajectory statistics (fromopenair::trajLevel()) to anyleafletmap, much likeaddTrajPaths()does for individual trajectories. It offers more control over groups and layer IDs thantrajLevelMap(), which now uses it internally.breakOpts()andcolourOpts()are now re-exported from openair.
Directional analysis maps
polarMap()andannulusMap()gainbreaks, in line withopenair::polarPlot()andopenair::polarAnnulus(), to bin the colour scale into discrete intervals. This takes a numeric vector of breakpoints, a number of intervals, oropenair::breakOpts(). A single set of breakpoints is calculated across all of the markers so they can share a legend.breaksoverrideslimits.-
Shared legends have been standardised, and now reflect the colour scale openair actually used to draw the markers:
Discrete colour scales (e.g., from
breaks) now get a legend of labelled colours, as long as all markers share the same intervals.Labels and colours now exactly match those used by openair, and are the same in dynamic and static maps (e.g.,
"0 to 50"rather than"0 – 50").Continuous legends are no longer drawn for transformed colour scales (e.g.,
trans = "log10"), as they would be misleading. This includesfreqMap()by default, asopenair::polarFreq()usestrans = "sqrt"; passlimitsandtrans = FALSEvia...to get a shared continuous legend.Dynamic legends now consistently use
alphafor their opacity.
addPolarMarkers()andaddPolarDiffMarkers()gainprogress, in line with thepolarMap()family, so the progress bar can be turned off.
Site maps
pointMap(),krigingMap()andvoronoiMap()gaintype, in line with thepolarMap()family. Eachtypelevel is summarised (and interpolated) separately on a shared colour scale. Levels become layers of a dynamic map (switched between using a “layer control” menu, customised using thecontrol.*arguments) or panels of a static map (arranged usingstatic.nrow). Other arguments can be passed toopenair::cutData()using....pointMap(),krigingMap()andvoronoiMap()gainpopupandlabel, which work like those inpolarMap(). If either includes thepollutant, the sitestatisticis shown and labelled as such (e.g., “NO2 (max)”). Other numeric columns are averaged at each site.
Trajectory maps
addTrajPaths()gainsmarkerColor, so the points along a trajectory can be coloured independently of its line (e.g., by a pollutant). It is also much faster whenlayerIdis used, with unchanged layer IDs.trajLevelMap()now passes...toopenair::cutData()(e.g.,type = "season", hemisphere = "southern"), in line withtrajMap(). Itspollutantargument also now defaults toNULL.Trajectory popups have been restyled to match those in
networkMap(). Path popups always show the time of the arrival and trajectory dates, andtrajMap()shows thecolourvariable (e.g., a pollutant) in its own row. Gridded popups lead with the value and statistic, followed by the grid cell location, count and (if used)typelevel.
Other
buildPopup()popups have been restyled to match those innetworkMap(), with each column shown as a grey label alongside its value. This also applies to the popups built automatically when severalpopupcolumns are given to a mapping function.buildPopup()also gainsname, which sets the name of the new column ("popup"by default), and now errors if this column already exists rather than returningpopup.xandpopup.y.networkMap()can now take any argument ofopenair::importMeta()via..., supersedingsearchNetwork(). It also no longer overrides the defaultyear.trajMap(),trajLevelMap(),krigingMap()andvoronoiMap()now accept any number of basemaps throughprovider, which can be named to label them in the layer control menu (e.g.,c("Default" = "OpenStreetMap", "Satellite" = "Esri.WorldImagery")), in line withpolarMap()andnetworkMap().The layer control menu now works the same way in all dynamic maps. Only the first basemap is shown initially, and a single basemap is no longer listed, as there is nothing to switch to.
Static maps gain
api_key, passed toggspatial::annotation_map_tile().
Bug fixes
Directional analysis maps
freqMap(statistic = "frequency")now shows the number of measurements in each bin. With recent versions of openair, it instead warned and showed the mean of an internal placeholder column, which also affectedbreaks = "fixed".Markers that openair can’t draw (e.g., due to too little data at a site) are now consistently skipped. Previously, dynamic maps showed a broken image in their place (and listed it in the layer control menu), and static maps errored. If no markers can be drawn at all, the error given by openair is now passed on.
-
popupandlabelare more robust:A single numeric column (e.g.,
popup = "no2") no longer errors. Numeric columns are now averaged at each marker and labelled as such (e.g., “NO2 (mean)”), whether one or severalpopupcolumns are given.diffMap()no longer errors when severalpopupcolumns are given.The latitude and longitude columns, and columns called “popup” or “label”, can now be used. Previously, they errored (e.g.,
popup = c("site", "lat")) or were overwritten (e.g.,popup = "label"showed “NA” in every popup). Internal columns also no longer overwrite columns called “dummy” (infreqMap()) or “dummyvar” (inaddPolarMarkers()).
Shared scales now better match the markers:
polarMap(limits = "fixed")uses the sameupperas the markers,percentileMap(intervals = "fixed")usespercentileand..., andfreqMap(breaks = "fixed")no longer errors whentransis passed via....The colours in the dynamic
percentileMap()legend now match those of the markers.percentileMap()no longer warns that “fixed”intervalsonly work with a single pollutant unlessintervals = "fixed"was explicitly set. This warning (also given bypolarMap(),annulusMap()andfreqMap()) now names the relevant argument.addPolarMarkers()now drops rows wherepollutantis missing, rather than whereno2is missing, and so no longer errors ifdatahas nono2column.windroseMap()now gives an informative error ifdatahas nowscolumn.The
polarMap()family,addPolarMarkers()andaddPolarDiffMarkers()no longer require carrier and mirai to be installed. These are now only needed to plot markers in parallel, after setting up workers withmirai::daemons().
Site maps
krigingMap()andvoronoiMap()now give informative errors ifpollutantis missing, can’t be found indataor has more than one value, or ifstatisticisn’t recognised.-
krigingMap()andvoronoiMap()no longer leave sites or parts of the surface uncoloured:Values outside
limitsnow take the colour of the nearest limit, as in openair.When the data fall outside
breaks, the outermost breaks are expanded to cover them (e.g.,breaks = c(50, 100, 150)becomesc(25, 100, 200)for data ranging from 25 to 200). Values equal to the lowest break are also now included.
krigingMap(statistic = "sd")andvoronoiMap(statistic = "sd")now treat sites with a single measurement as missing, rather than using the measurement itself.Static
krigingMap()andvoronoiMap()maps now respectprovider, rather than always using OpenStreetMap.
Trajectory maps
trajMap()andaddTrajPaths()now support data with multiple receptors, as returned byopenair::importTraj(). Previously, trajectories arriving at different receptors at the same time were joined into a single path.trajLevelMap()now respectscontrol.collapsedandcontrol.position. Note that this means its layer control is now expanded by default, in line withtrajMap().trajLevelMap(statistic = "difference")now uses the correct ordinal suffix forpercentile(e.g.,"11th"rather than"11st","1st"rather than"1th", and"92.5th"rather than"92.5nd").trajLevelMap()now explains that rnaturalearth is needed (byopenair::trajLevel()) if it isn’t installed.addTrajPaths()popups now respectlngandlat. Previously, the latitude and longitude were blank unless the columns were called “lon” and “lat”.
Other
trajMap(),trajLevelMap(),networkMap(),krigingMap()andvoronoiMap()now validateproviderin the same way as thepolarMap()family, giving an informative error for unrecognised basemaps and accepting the same shorthand names (e.g.,"cartolight").Dynamic maps now error if more than one
legend.positionorcontrol.positionis given.networkMap()now checkscontrol.positioneven whencontrolisn’t used.Dynamic
krigingMap(),voronoiMap(),trajMap()andtrajLevelMap()legends now usealphafor their opacity.Fewer noisy messages:
krigingMap()no longer prints gstat’s progress for everytypelevel (turn it back on with, e.g.,args.idw = list(debug.level = 1)),voronoiMap()no longer warns that “attribute variables are assumed to be spatially constant”, and staticpolarMap()family maps no longer warn that “st_point_on_surface may not give correct results”.buildPopup()now shows columns in the order given incolumns, summarisesDatecolumns (usingfun.dttm) and logical columns (usingfun.character), and shows the latitude and longitude columns as-is. Previously, columns were ordered by type,Dateand logical columns errored, and latitude/longitude columns either errored (if named) or were left out.quickTextHTML()now correctly formats"m/s2".
openairmaps 0.10.1
CRAN release: 2026-05-20
New features
The entire
polarMap()family now defaults toannotate = FALSE, which removes many of the “captions” added automatically since openair v.3.1.0. These can be restored by passingannotate = TRUEto....trajLevelMap()has gainedbreaksin line withopenair::trajLevel().trajMapStatic()andtrajLevelMapStatic()now callopenair::trajMap()andopenair::trajLevel(), respectively. This is an advancement towards complete removal, which will happen in a future version ofopenairmaps.
openairmaps 0.10.0
CRAN release: 2026-04-04
Breaking Changes
openairmaps now depends on a minimum R version of 4.1.0 and no longer exports the magrittr pipe (
%>%). Users are encouraged to use the base R pipe (|>) instead. In most cases, this is a drop-in replacement.-
openairmaps now requires a a minimum openair version of 3.0.0. Polar markers are therefore now produced using
ggplot2. This has allowed thethemeargument to be added to thepolarMap()family, which allows for extensive customisation of polar markers. This has included the following changes:keyhas been replaced withkey.position, in line with deprecations in openair.Polar markers will inherit any styling set using
ggplot2::theme_set(). This may be unfavourable, but can be partially overriden using the newthemeargument.
The
polarMapStatic()family have been removed. ThetrajMapStatic()family are still exported but have been deprecated.
New features
The
polarMap()gains thethemeargument for customising theggplot2theme of the markers.-
Added a new ‘spatial interpolation’ family of functions, which rely on the suggested stars, terra and gstat packages. These functions are most useful for dense air quality networks, and can be useful for identifying spatial patterns and hotspots of air pollution.
krigingMap()allows for smooth spatial interpolation, either using simple inverse distance weighting or full point kriging.voronoiMap()usesterra::voronoito create a polygonal map of ‘closest observations’.
Polar marker functions (both the
polarMap()family andaddPolarMarkers()) can now be run asynchronously if the user setsmirai::daemons(). Internally, this usespurrr::in_parallel().The progress bar shown when
progress = TRUEnow better reflects the actual time until function completion.networkMap()can now usesource = 'imperial', in line with updates to openair.
Refactoring
This release includes several changes to make openairmaps more lightweight.
ggspatial, prettymapr and ggtext, the packages which support static mapping, have been moved to
SuggestsfromImports. This gives the package a smaller size for users who only use openairmaps for interactive mapping. On first trying to use a static mapping function, users will be prompted to install these packages.{mgcv}has been moved toSuggestsas it is only used in one place (trajLevelMap(smooth = TRUE))convertPostcode()now uses curl over httr.Removed dependency on forcats.
Removed suggested dependency on worldmet.
openairmaps 0.9.1
CRAN release: 2024-11-19
New features
Pairwise statistics (e.g.,
"robust_slope") are now supported bypolarMap(). (#72)The
polarMap()family has gained theprogressargument, allowing users to switch the progress bar on and off.trajMapStatic()has gained thesizeandlinewidtharguments, which directly map onto the arguments inggplot2::geom_point()andggplot2::geom_path(), respectively. These can either be a column of the data (likecolour), or can be an absolute value (e.g.,2L). Note that, by default,linewidthtakes the value ofsize, but both can be set independently.
Bug fixes
Vectors greater than length 1 passed to
popupin thepolarMap()argument will no longer error whentype = NULL....will successfully pass toopenair::cutData()in thepolarMap()andtrajMap()families of functions.The default
diffMap()colour scale will no longer appear inverted compared toopenair::polarDiff().Fixed an issue in which
quickTextHTML()would incorrectly format non breaking spaces when doing, e.g.,quickTextHTML("ug/m3").The order in which
trajMapStatic()draws points and paths has been tweaked, which should ensure that markers are drawn on top of their respective path, rather than on top of all paths.buildPopup()will now work correctly if notypeis provided.
openairmaps 0.9.0
CRAN release: 2024-05-19
Breaking changes
BREAKING: The
polarMapStatic()family is now powered by ggspatial rather than ggmap as it does not require an API key. This means theggmapargument has been removed and theproviderargument has been added. Other benefits of this switch include a greater number of available base maps (see:rosm::osm.types()) and the ability to simply change the extent of the map axes usingggplot2::coord_sf(). (#52)BREAKING: The
controlandfacetarguments have been deprecated in favour oftypein all functions. These arguments will eventually be removed, but as of this version of openairmaps users will be warned away from their use. This brings openairmaps in-line with the openair package.BREAKING: The
namesandcolsarguments ofbuildPopup()have been coalesced into a singlecolumnsargument for less verbose function usage.BREAKING: The
collapse.controlargument has been renamed tocontrol.collapsedand thedraw.legendargument tolegend. This is to allow these options to sit more nicely with their new argument family members -legend.title,legend.title.autotext,legend.position, and so on.
New features
-
The
polarMapStatic()family of functions have been combined with thepolarMap()family, with static maps available to be accessed using thestaticargument. (#59) ThepolarMapStatic()family are therefore deprecated, and will later be removed from openairmaps. The justification for this is as follows:The combined functions allows for a more simple, consistent API for users (e.g., avoiding needing to switch between
facetandcontrol).The use of the
staticargument allows for simple switching between dynamic and static maps. For example, a researcher may wish to use the dynamic maps for data exploration, but then switch to a static map for placement into a PDF report.Recent developments have meant that the arguments and capability of these functions have started to align regardless (e.g.,
provider,crs).Combining these functions has reduced repetition in the source code of openairmaps, reducing the likelihood of oversights and bugs, and allowing for more rapid development.
The
crsargument has been added to thepolarMap()andpolarMapStatic()families and tosearchNetwork(). This argument allows for users to specify that their data is using an alternative coordinate system to the standard longitude/latitude (e.g., the British National Grid CRS). Alternate CRS will be re-projected to longitude/latitude for plotting as this is expected by leaflet / ggspatial. (#56)Users now have greater control over the positions of legends and layer control menus, and the titles of legends, throughout openairmaps functions, including the
polarMap()family,trajMap()family, andnetworkMap().Popups for the dynamic
polarMap()family will now be near the top of the plot rather than the centre. This will obscure less of the plot itself while the marker is visible. (#55)quickTextHTML()’s lookup table has gained new pollutants and units, and ignores the input case oftextmore consistently.Two examples of the use of openairmaps with shiny have been added to the package. Run
shiny::runExample(package = "openairmaps")to view these. (#60)
Bug fixes
Legends drawn by the
polarMapStatic()function should now render using more recent versions of ggplot2.-
The
addTrajPaths()layerIdargument is now implemented in a sensible way to ensure each geometry has a uniquelayerIdand can therefore be interacted with in a shiny context.-
layerIdis now the base on which the actual layerId is built, with each real layerId in the form BASE-LN-PN where LN is the line number and PN is the point number. For example, iflayerId = "traj", the first point of the first line has the ID"traj-1-1", the second point of the first line has ID"traj-1-2", the first point of the second line has ID"traj-2-1", and so on.
-
“illegal” file path characters can now be used in the columns provided to the
typeargument of thepolarMap()family. Most relevant to most users is that this will allow them to provide their own custom HTML tags - e.g., for formatting superscripts, subscripts, and so on. (#63)The colours in the legend of
networkMap()now better align with the actual colours of the markers, and the layer control menu whencontrol = "variable"is now presented in a nicer order with clearer labels.
openairmaps 0.8.1
CRAN release: 2023-11-03
This is a minor release of openairmaps, released mainly to fix an issue with ggmap but also adding some new functionality for polar marker maps.
Breaking changes
BREAKING: The arguments of
addPolarMarkers()have been rejigged to move “data” after “pollutant”, owing to the new use ofleaflet::getMapData(). (#45)BREAKING: The default arguments of some
polarMap()-family functions have changed from, e.g.,NULLto"free"or"fixed". (#34)BREAKING: Due to changes in ggmap, all static polar plotting functions now require users to provide their own
ggmapobject. Thezoomargument has also been removed. This is specifically related to the partnership of Stamen and Stadia which has put the stamen tiles behind an API. See https://maps.stamen.com/stadia-partnership/ and https://github.com/dkahle/ggmap/issues/353 for more information. (#52)
New features
-
Several “limit” arguments can now take one of three options: “fixed” (which forces all markers to share scales), “free” (which allows them to use different scales), or a numeric vector to define the scales. (#34) These arguments and their defaults include:
-
polarMap():upper(fixed);limits(free) -
annulusMap():limits(free) -
freqMap():breaks(free) -
percentileMap():intervals(fixed)
-
Added
searchNetwork(), which allows users to find local air quality monitoring sites by specifying a target latitude and longitude. Function arguments allow the site metadata to be subset (for example, by site type, pollutants measured, or distance from the target).Added
convertPostcode(), which converts a valid UK postcode to a latitude/longitude pair. This is intended to be used withsearchNetwork().The “data” argument of
addPolarMarkers()andaddTrajPaths()and both the “before” and “after” arguments ofaddPolarDiffMarkers()now default toleaflet::getMapData(map). This makes their use less verbose when creating multiple polar plots with the same underlying data, which will likely be a common use-case. (#45)networkMap()popups now contain links to the associated network websites. For example, the popup for London Marylebone Road innetworkMap("aurn")now contains a link to https://uk-air.defra.gov.uk/networks/site-info?site_id=MY1. All networks are supported with the exception of “europe”. (#39)addPolarMarkers()andaddPolarDiffMarkers()now have all of the “options” arguments ofleaflet::addMarkers(). This means that, for example, polar markers can be clustered (https://leafletjs.com/reference.html#marker). (#38)The
polarMap()family andnetworkMap()providerargument can now take a named vector. The names will be used in the layer control menu, iflength(provider) > 1. (#42)
openairmaps 0.8.0
CRAN release: 2023-03-31
This is a minor release adding a range of quality of life features, adding two new experimental functions, and fixing a few bugs.
New features
-
trajMapStatic()andtrajLevelMapStatic()have been added as two new experimental functions to provide ggplot2 equivalents ofopenair::trajPlot()andopenair::trajLevel(). (#28)- These are experimental as the long term place for these functions is uncertain; there will definitely be need for a ggplot2 incarnation of the trajectory plotting functions, but whether they will sit in openair,
{ggopenair}or openairmaps and what they will be named is not clear.
- These are experimental as the long term place for these functions is uncertain; there will definitely be need for a ggplot2 incarnation of the trajectory plotting functions, but whether they will sit in openair,
The
controlandfacetarguments of all polar marker mapping functions (static and interactive) and trajectory mapping functions are now passed toopenair::cutData().The
popupargument of all interactive polar marker mapping functions can now take a vector of column names. If more than one column is provided, it is automatically passed tobuildPopup()using its default values.trajLevelMap()now has thecontrolargument, which maps directly onto thetypeargument ofopenair::trajLevel(). Like othercontrolarguments elsewhere in openairmaps, this creates a “layer control” menu.networkMap()now uses different coloured markers for different networks. If more than one network is specified, anddraw.legendis set toTRUE, a legend will also be drawn for quick identification of different data sources. (#30)Deprecations are now managed by the lifecycle package. This currently only applies to the
typeargument.
Bug fixes
Fixed issues where multiple
addPolarMarkers()chained together would all show the same plot.Fixed issue where
...andpollutantweren’t being passed toaddPolarMarkers(). (#27)Fixed issue in
trajMap()caused by recent updates to dplyr and forcats.-
Fixed issue where
polarMapStatic()and others would turn factor facet levels into characters. Fixed issue where
polarMapStatic()and others would error when trying to draw a legend.
openairmaps 0.7.0
CRAN release: 2023-02-09
This is a minor release containing several important new features that expand the scope of the package. This also comes with several minor breaking changes to improve consistency within openairmaps and with openair.
Breaking changes
-
BREAKING: The
fig.width,fig.height,iconHeightandiconWidtharguments have been replaced withd.figandd.icon. There are two main justifications behind this:This ensures consistency across all of openairmaps, making it easier to switch between the static and HTML map types.
Polar markers are almost always going to be circular (i.e., width = height) so having one argument will streamline things. If users wish to have non-circular markers, a vector of length two in the form
c(width, height)will provide the same functionality.
BREAKING: The arguments in
addPolarMarkers()have been put in a more sensible order, leading withdata,pollutantandfun.BREAKING: The
dateargument fromnetworkMap()has been replaced byyear. (#26)
New features
-
Added “static” equivalents of all of the polar marker maps written in ggplot2. While interactive HTML maps are preferred, the static equivalents may be more appropriate for, e.g., academic publications. (#19)
The ggplot2 functions can be identified by “Static” being appended to the function name. For example,
polarMap()is the leaflet polar plot map, whereaspolarMapStatic()is the ggplot2 equivalent.Currently, “static” versions of the trajectory maps are served by
openair::trajPlot()andopenair::trajLevel(), but there may be space in future to haveggmapequivalents of these inopenairmaps.
Added
diffMap()anddiffMapStatic()which are toopenair::polarDiff()whatpolarMap()andpolarMapStatic()are toopenair::polarPlot()(#17). Also addedaddPolarDiffMarkers(), which is the equivalent ofaddPolarMarkers(). (#25)Added
alphaas an argument to all of the directional analysis polar mapping functions, not justpolarMap(). (#14)Fixed
alphato work on both Windows and MacOS by forcing the use of the “cairo” device to save plots. (#14)Polar marker maps and
addPolarMarkers()now show a progress bar when creating the markers takes more than a few seconds (most commonly inpolarMap()andannulusMap(), particularly with multiple pollutants/control groups).networkMap()can now pass the newyearoption toimportMeta().
openairmaps 0.6.1
CRAN release: 2023-01-09
This is a patch release primarily to fix a few bugs in openairmaps, and implement a new default colour scheme after a recent openair update.
New features
- Functions now use the
"turbo"colour palette rather than"jet"by default, which is still a rainbow palette but with more perceptually uniform colours.
Bug fixes
Fixed issue with polar marker maps (e.g.,
polarMap()) and the genericaddPolarMarkers()function where lat/lon info in the Southern Hemisphere would misalign markers. Hat tip to Deanna Tuxford and James for noticing this issue. (#18)Fixed an issue with
networkMap()wherecontrol = "variable"would fail to show all pollutants.
openairmaps 0.6.0
CRAN release: 2022-11-28
This is a minor release, mainly focusing on enhancing the ability for polar markers to have shared colour scales, but also incorporating new features for network visualisation.
New features
All directional analysis maps can now have their limits provided (can be “limits”, “breaks”, “percentiles”, etc., depending on function). This was always possible through
..., but it is now explicitly listed as an option. (#12)If limits are defined in a directional analysis function, a shared legend will now be drawn at the top-right of the map. This functionality can be disabled by setting
draw.legendto FALSE. (#12)Added the
buildPopup()function, which allows users to easily construct HTML popups for use with the “popup” argument of directional analysis maps (orleafletmaps more widely).The default options for fig.width and fig.height are now
3.5rather than4. This appears to remove some visual artefacts and makes the axis labels more legible.networkMap()now supports multiple sources. For example, usingsource = c("aurn", "saqn")will show both the AURN and SAQN on one map. This may be useful if users are interested in air quality in a specific region of the UK (e.g., users may wish to locate AURN, AQE and locally managed sites near to a given urban centre). (#16)networkMap()now supportssource = "local".Multiple basemap providers can now be used with
networkMap().networkMap(),trajMap()and all polar directional analysis maps have gained thecollapse.controlargument, which controls whether the control menu starts collapsed or not. It defaults toFALSE, which means the control menu is not collapsed.All documentation has been improved; function parameters are more consistent between functions and arguments passed to
openairvia...are now explicitly listed.
Bug fixes
- The “alpha” option has been removed for all directional analysis functions except
polarMap()as it only ever worked forpolarMap().
openairmaps 0.5.1
CRAN release: 2022-10-20
This is a patch release designed to fix a major bug in v0.5.0.
openairmaps 0.5.0
CRAN release: 2022-10-19
This is a minor release centred around the addition of the control argument, which allows for arbitrary columns to be used in “layer control” menus.
Breaking changes
All functions now use latitude and longitude to distinguish between site types. Therefore, “type” is now deprecated. Maps using the old system will still render, but popups will not be displayed. For most users, to restore previous site labels simply rewrite
type = "site"aspopup = "site". (#10)The default values for “pollutant” have all been removed. Any users relying on this default should update their code to explicitly state
pollutant = "nox".
New features
All functions now possess the “control” argument, which allows users to create a “layer control” menu with any arbitrary column. Appropriate columns may be those produced using
openair::cutData(),openair::splitByDate(), or a user-defineddplyr::case_when()/dplyr::if_else()column transformation. (#9)All functions now possess the “popup” and “label” arguments, which control pop-up and hover-over labels, respectively. This allows users to define any popup or label column, even non-unique ones. For example, multiple sites can be labelled with identical site types. (#10)
All functions now try to guess the latitude/longitude column if not provided, similar to leaflet. (#10)
Updated many error messages and warnings to use cli and be broadly more descriptive.
openairmaps 0.4.3
CRAN release: 2022-09-13
This is a patch release adding a small number of refinements.
Breaking changes
polar_datacolumn names changed from “latitude” to “longitude” to “lat” and “lon” to reflect the defaults of thepolarMap()family.trajMap()andtrajLevelMap()now use the argument names “latitude” and “longitude” to match those of thepolarMap()family.
New features
-
trajLevelMap()now contains thelat.incandlon.incarguments.
openairmaps 0.4.2
This is a patch release to fix a bug with trajLevelMap().
Bug fixes
-
trajLevelMap()now works wherestatistic = "frequency"without a “pollutant”.
openairmaps 0.4.1
This is the first CRAN release of openairmaps.
Features
-
There are currently three streams of functionality in
openairmaps:networkMap()visualises any of theopenair::importMeta()networks.polarMap()and family allow for any of theopenairdirectional analysis plots to be used as leaflet markers.trajMap()and family are leaflet equivalents toopenair::trajPlot()andopenair::trajMap().
-
There are two main classes of functions:
*Map()functions are easy-to-use functions which create leaflet maps from the ground-up. These are the most similar toopenairfunctions.add*()functions are more flexible and allow users to add layers to existing leaflet maps. These are designed to be similar to theleaflet“add” functions likeaddMarkers().
