##Introduction

This is the assignment corresponding to JHU’s “Developing Data Products” course, as part of the programme “Data Science Specialization”, delivered through Coursera. This is the Week 2 project.

##Map creation

The first thing would be to add blank map, where we will be adding the our location and the associated features.

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

Once done that, we’ll add the coordinates of the place and a pop-up to see where we are heading towards.

map_location <- leaflet() %>% addTiles() %>% addMarkers(lng = -4.0413, lat = 39.8650, 
                                                        popup = "The University/college I studied")

It’s the “Universidad de Castilla-La Mancha” (UCLM), located in the city of Toledo (Spain). Finally, that sort of “bubble” will be replaced by the college logo. In the first place, a URL will be linked to the icon, together with the dimensions it will have. Then the variable with the icon is added with the other features using the pipeline shown below. Then the map location is called.

library(leaflet)
UCLMIcon <- makeIcon(iconUrl = "https://upload.wikimedia.org/wikipedia/commons/thumb/e/ee/LogoUCLM.svg/360px-LogoUCLM.svg.png", 
                     iconWidth = 40*215/230, iconHeight = 40,
                     iconAnchorX = 40*215/230/2, iconAnchorY = 19)
map_location <- leaflet() %>% addTiles() %>% addMarkers(lng = -4.0413, lat = 39.8650, 
                                        popup = "The University/college I studied, located in Toledo(Spain)",
                                        icon = UCLMIcon)
map_location