Summary

Create a web page of map with R markdown and leaflet.

July, 5, 2019

library(leaflet)
stonybrookSite <- "<a href='https://www.stonybrook.edu'>A greate place to go</a>"

stonybrookIcon <- makeIcon(
  iconUrl = "https://pbs.twimg.com/profile_images/1123547897348358144/J99k3stV_400x400.png",
  iconWidth = 31*215/230, iconHeight = 31,
  iconAnchorX = 31*235/230/2, iconAnchorY = 16
)
my_map <- leaflet() %>% addTiles() %>% addRectangles(lat1 = 40.78, lng1 = -73.0, lat2 = 40.98, lng2 = -73.2) %>%
  addMarkers(lat = 40.91, lng = -73.122, icon = stonybrookIcon, popup = stonybrookSite)

my_map