-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
Description
Here's an example illustrating how to generate a topology map showing the 300' and the 600' windsocks on Ed Levin using R:
library(leaflet)
m <- leaflet()
m <- m |> addTiles(urlTemplate = "https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png")
m <- m |> setView(lat = 37.4611, lng = -121.8625, zoom = 17)
## 300' windsock
m <- m |> addMarkers(lat = 37.4611738, lng = -121.8646301, label = "300ft windsock", labelOptions = labelOptions(noHide = TRUE))
## 600' windsock
m <- m |> addMarkers(lat = 37.4612652, lng = -121.8604359, label = "600ft windsock", labelOptions = labelOptions(noHide = TRUE))
## Open (sic!) interactive leaflet map in web browser
print(m)To save the same view as a static PNG file, use:
mapview::mapshot2(m, file = "edlevin.png")This produces:
Installation instructions
Assuming modern version of R, install packages using:
$ R
...
> install.packages(c("mapview", "webshot2"))