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!
library(leaflet)
dieMobiliarIcon <- makeIcon(
iconUrl = "./dieMobiliar.png",
iconWidth = 2*31*215/230, iconHeight = 31/2,
iconAnchorX = 31*215/230/2, iconAnchorY = 16
)
First, make a map of Switzerland
Define the Positions of the sites:
dieMobiliarLatLong <- data.frame(
lat = c(46.945348, 46.384316, 47.413761),
lng = c(7.437854, 6.213373, 8.537127)
)
Then define the Popups per site:
dieMobiliarSites <- c(
"<a href='https://www.mobiliar.ch/die-mobiliar/ueber-uns/direktionsstandorte'>Mobiliar Direktion Bern</a>",
"<a href='https://www.mobiliar.ch/die-mobiliar/ueber-uns/direktionsstandorte'>Mobiliar Direktion Nyon</a>",
"<a href='https://www.mobiliar.ch/die-mobiliar/ueber-uns/direktionsstandorte'>Mobiliar Direktion Zürich</a>"
)
Then add the Icons at their relative position with popups linked to the main site to get adresses: