Skip to content

Instantly share code, notes, and snippets.

@csaybar
Last active July 8, 2020 22:32
Show Gist options
  • Save csaybar/e75cc4e93755bba97f7e3d1200613386 to your computer and use it in GitHub Desktop.
Save csaybar/e75cc4e93755bba97f7e3d1200613386 to your computer and use it in GitHub Desktop.
presentation
suppressPackageStartupMessages(library(mapview))
suppressPackageStartupMessages(library(sf))
mapviewOptions(
basemaps = c(
"Esri.WorldImagery", "OpenTopoMap",
"CartoDB.Positron", "CartoDB.DarkMatter",
"OpenStreetMap"
)
)
peru <- st_point(c(-77.09360, -11.96751)) %>%
st_sfc(crs = 4326) %>%
st_sf(location = "Lima, Peru")
austria <- st_point(c(13.04570, 47.79966)) %>%
st_sfc(crs = 4326) %>%
st_sf(location = "Salzburg, Austria")
Journey <- st_linestring(
matrix(
data = c(-77.09360, 13.04570, -11.96751, 47.79966),
nrow = 2
)
) %>%
st_sfc(crs = 4326) %>%
st_sf(location = "travel")
Legend <- rbind(peru, austria)
m <- mapview(Journey, color = "red", lwd = 3, legend = FALSE, homebutton = FALSE) +
mapview(Legend, legend = FALSE, homebutton = FALSE)
m <- addLogo(m, "https://user-images.githubusercontent.com/16768318/84294830-5c52a280-ab0f-11ea-8e06-12f55c6781c9.png",
position = "bottomright",
offset.x = 50,
offset.y = 50,
width = 120,
height = 40)
m
@csaybar
Copy link
Author

csaybar commented Jun 10, 2020

@csaybar
Copy link
Author

csaybar commented Jul 8, 2020

tumblr_427db1594732af1652315d5a0e8b08d5_1257bdc4_500
86974428-f07a4e80-c13b-11ea-82b6-d6b25f822863

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment