Friday 15th July

library(leaflet)

Make Map

my_map <- leaflet() %>%
    addTiles() %>%
    addMarkers(lat=51.51236, lng=-0.08505, popup="My Office") %>%
    addMarkers(lat = 51.50148, lng= -0.14189, popup = "My Home")
my_map

Add in own Icons

home <- makeIcon(
    iconUrl = "https://static.thenounproject.com/png/213347-200.png",
    iconWidth = 31*215/230, iconHeight = 31, iconAnchorX = 31*215/230/2, iconAnchorY = 16);

office <- makeIcon(
    iconUrl = "https://www.freeiconspng.com/uploads/building-business-garage-office-icon--icon-search-engine-3.png",
    iconWidth = 31*215/230, iconHeight = 31, iconAnchorX = 31*215/230/2, iconAnchorY = 16);
my_map <- leaflet() %>%
    addTiles() %>%
    addMarkers(lat=51.51236, lng=-0.08505, popup="My Office", icon = office) %>%
    addMarkers(lat = 51.50148, lng= -0.14189, popup = "My Home", icon = home)
my_map