I will submit a map that shows the university I attended by using leaflet and also shows the location with the icon picture by using the logo of my university with a popup hyperlink to my university’s website.
Let’s start with creating two variables for the icon and hyperlink.
library(leaflet)
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
myicon <- makeIcon(
iconUrl = "https://upload.wikimedia.org/wikipedia/en/2/27/Dokuz_Eylul_University_logo.png",
iconWidth = 31*215/230,
iconHeight = 31,
iconAnchorX = 31*215/230/2,
iconAnchorY = 16
)
my_uni_url <- "<a href='http://www.deu.edu.tr'>My University</a>"
Next I will create the map and pass on the variables I created above.
my_map <- leaflet() %>%
addTiles() %>%
addMarkers(lng = 27.2075679708788, lat = 38.37006933506166,
popup = my_uni_url,
icon = myicon)
my_map