View source: R/gg_CreateBasemapLayers.R
gg_CreateBasemapLayers | R Documentation |
This function creates a basemap layer for maps based on the ggplot2 package.
gg_CreateBasemapLayers(
layer.land = getPackagedLayer("Alaska"),
layer.bathym = getPackagedLayer("ShelfBathymetry"),
final.crs = get_crs("WGS84"),
bbox = getStandardBBox("EBS"),
colors.bg = "white",
colors.land = "grey85",
colors.bathym = "darkblue",
alpha.bathym = 1
)
layer.land |
|
layer.bathym |
|
final.crs |
|
bbox |
|
colors.bg |
|
colors.land |
|
colors.bathym |
|
alpha.bathym |
|
The basemap contains a land layer (polygons) and a bathymetry layer (lines).
Uses getPackagedLayer
or wtsUtilities::readShapefile
to create the
land and bathymetric layers. If bbox
is NULL, then the
bounding box for the land layer is used as the bounding box for the basemap.
The final coordinate reference system (final.crs
) can be any object that
can be converted to a sf::crs
object using get_crs
.
The bounding box (bbox
) can be any object that can be converted
to a sf::bbox
using getBBox
.
layer.land and layer.bathym will first be transformed to the bounding box coordinates and cropped to the bounding box. All three will then be converted to the final.crs coordinate system.
If the bounding box is NULL, it will be created from the bounding box for layer.land (if not NULL) or layer.bathym (if layer.land is NULL.
If final.crs is NULL, it will be set to the CRS for the bounding box.
basemap layer based on the ggplot2 package
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.