getBasemapLayers | R Documentation |
Function to get a set of ggplot2 layers for a basemap.
getBasemapLayers( czType = c("2020", "2019"), xy = FALSE, bw = FALSE, noBathym = FALSE )
czType |
- type of connectivity zone to get ("2020"or "2019") |
xy |
- flag (T/F) for coordinate type (TRUE=Alaska Albers projection; FALSE=WGS84 lat/lon) |
bw |
- flag (T/F) for black & white or color scheme |
noBathym |
- flag (T/F) to not include bathymetry layer (default=FALSE) |
If xy
is TRUE, 'bathym' and 'map_scale' in the returned list will be NULL (currently).
Note that including 'theme' in the basemap simply removes the axis labels, which would otherwise be 'x' and 'y'.
list with ggplot2 layers 'bathym', 'land', 'zones', 'labels', 'map_scale', and 'theme'.
A default lat/lon basemap in color can be constructed using the following:
require(ggplot2); lst = getBaseMapLayers("2020",FALSE,FALSE); ggplot()+lst$bathym+lst$land+lst$zones+lst$labels+lst$map_scale+lst$theme;
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.