The source code is available at GitHub. Just click here!

Proplem

Create a web page using R Markdown that features a map created with Leaflet.

Host your webpage on either GitHub Pages, RPubs, or NeoCities.

Your webpage must contain the date that you created the document, and it must contain a map created with Leaflet. We would love to see you show off your creativity!

Solution

Create a leaflet map object.

library(leaflet)
map <- leaflet() %>% addTiles()

Create a marker with a picture of True Digital Park and a link to its homepage.

benrathPalaceIcon <- makeIcon(
   iconUrl = "https://s3-ap-southeast-1.amazonaws.com/truedigitalparkbucket/images/Overall-TrueDigitalPark.jpg",
   iconWidth = 30*408/255, iconHeight = 40,
   iconAnchorX = 30*408/255/2, iconAnchorY = 30/2
)

Add the marker to the map and display the map.

TDPKPopup <- c("True Digital Park Bangkok TH<br><img src='https://s3-ap-southeast-1.amazonaws.com/truedigitalparkbucket/images/Overall-TrueDigitalPark.jpg' width='210' height='132'  alt='True Digital Park' title='True Digital Park'></a>")
map %>%
   addTiles() %>%
   addMarkers(lat=13.686008, lng=100.610995, popup = TDPKPopup)