Description Usage Arguments Value See Also Examples
This function corrects a bug (some polygons are not correctly projected) in
the function maps:map()
when it is used in orthographic projection. The
function orthomap()
also returns projected polygons in the
sp:SpatialPolygons
format.
1 2 3 4 |
query |
The name of a country to center the map on. |
centre |
Latitude and longitude of the map center. Ignored if query is not |
border.color |
Color of polygons border. |
border.type |
Type of polygons border line (see argument |
border.size |
Size of polygons border line (see argument |
fill |
Color of polygons. |
globe |
Color of globe background. |
grid |
If TRUE, grid (i.e. graticules) are added to the map. |
nx |
Number of longitude lines. |
ny |
Number of latitude lines. |
grid.color |
Color of the grid. |
grid.type |
Type of grid (see argument |
grid.size |
Line width of the grid (see argument |
... |
Additional graphical parameters (see |
A SpatialPolygons
of world countries in orthographic projection without aberrations.
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 | # Default settings
world <- orthomap()
class(world)
length(world)
sp::plot(world)
# Center map based on country name
world <- orthomap(query = "France")
# Center map based on coordinates
world <- orthomap(centre = c(45, 125))
# Customize map
world <- orthomap(
centre = c(45, 125),
border.color = "#dddddd",
border.type = 1,
border.size = 0.25,
fill = c("#0868ac", "#016c59", "#b30000"),
globe = "#b3d0d1",
grid = TRUE,
nx = 20,
ny = 20,
grid.color = "#969696",
grid.type = 1,
grid.size = 0.25,
mar = rep(0, 4),
bg = "#dddddd"
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.