Packages/Libraries

Here are the packages you will need to create the map. Note you must install the libraries first.

# Special functions to make coding easier
library(magrittr)
library(tidyverse)
## Warning: package 'tidyverse' was built under R version 4.0.5
## -- Attaching packages --------------------------------------- tidyverse 1.3.1 --
## v ggplot2 3.3.5     v purrr   0.3.4
## v tibble  3.1.6     v dplyr   1.0.7
## v tidyr   1.1.4     v stringr 1.4.0
## v readr   2.1.0     v forcats 0.5.1
## Warning: package 'tibble' was built under R version 4.0.5
## Warning: package 'tidyr' was built under R version 4.0.5
## Warning: package 'readr' was built under R version 4.0.5
## Warning: package 'dplyr' was built under R version 4.0.5
## Warning: package 'forcats' was built under R version 4.0.4
## -- Conflicts ------------------------------------------ tidyverse_conflicts() --
## x tidyr::extract()   masks magrittr::extract()
## x dplyr::filter()    masks stats::filter()
## x dplyr::lag()       masks stats::lag()
## x purrr::set_names() masks magrittr::set_names()
# To create map
library(leaflet) 
## Warning: package 'leaflet' was built under R version 4.0.5

Testing

Here is a small example to create a simple map and get familiar with different functions.

#creates the icon
icons <- awesomeIcons(
  icon = 'ios-close',
  iconColor = 'black',
  library = 'ion'
)

#creates the map
my_map <- leaflet() %>%
  addTiles() %>%
  addAwesomeMarkers(lat = 29.58284045149699, lng = -98.61892004070472, 
             label = "UTSA",
             icon = icons)
my_map

Final Map

Here is the code to create the map with all the different places you can use the DTSA Lux Card at.

#Creates a normal blue icon
icon.blue <- awesomeIcons(
  icon = 'ios-close',
  iconColor = 'black',
  library = 'ion'
)

#Creates a red flag icon
icon.fa <- makeAwesomeIcon(
  icon = "flag", markerColor = "red",
  library = "fa",
  iconColor = "black"
)
help("makeAwesomeIcon")
## starting httpd help server ... done
DTSA_Map <- leaflet() %>%
  addTiles() %>%
#The Three different apartments location with a red flag icon
  addAwesomeMarkers(lat = 29.426220, lng = -98.488564, 
                    label= "Maverick - Apartments",
                    icon = icon.fa) %>%
  
  addAwesomeMarkers(lat = 29.419570859871996, lng = -98.486538803024, 
                    label= "The 68th - Apartments",
                    icon = icon.fa) %>%
  
  addAwesomeMarkers(lat = 29.437410, lng = -98.479330, 
                    label= "1221 - Apartments",
                    icon = icon.fa) %>%
  
  
  
#different locations to use the black lux card at with blue icon
  addAwesomeMarkers(lat = 29.420146732713743, lng = -98.4877760155078, 
                    label= "Magik Theatre, Discount: 20% OFF season tickets, 10% OFF (single tickets)",
                    icon = icon.blue) %>%
  
  addAwesomeMarkers(lat = 29.41972598821283, lng = -98.48662303087116, 
                    label= "The Box Street Social, 10% OFF",
                    icon = icon.blue) %>%
  
  addAwesomeMarkers(lat = 29.430262267954603, lng = -98.47755384621405, 
                    label= "Alamo Beer Company, 20% OFF (Food) ",
                    icon = icon.blue) %>%
  
  addAwesomeMarkers(lat = 29.607827224995415, lng = -98.495527259704, 
                    label= "Recharge Zone IV, 50% OFF",
                    icon = icon.blue) %>%
  
  addAwesomeMarkers(lat = 29.435268935147672, lng = -98.47911397689994, 
                    label= "Elevate Dental, 50% OFF In-Office Whitening",
                    icon = icon.blue) %>%
  
  addAwesomeMarkers(lat = 29.437288224801314, lng = -98.47989264436364, 
                    label= "Bare Sunless,  15% OFF (single services)",
                    icon = icon.blue) %>%
  
  addAwesomeMarkers(lat = 29.443055245272287, lng = -98.48276575970657, 
                    label= "Soular Therapy, 20% OFF All Fragrances",
                    icon = icon.blue) %>%
  
  addAwesomeMarkers(lat = 29.50513246975766, lng = -98.45839687553527, 
                    label= "Beauty Lab, 15% OFF All Services",
                    icon = icon.blue) %>%
  
  addAwesomeMarkers(lat = 29.45186775118883, lng = -98.48583351050675, 
                    label= "Medina Eye Care, $55 Eye Exam / 20% OFF (Complete Eyewear)

",
                    icon = icon.blue) %>%
  
  addAwesomeMarkers(lat = 29.424168733291356, lng = -98.48874239143078, 
                    label= "Riverwalk Spirits and Wine, 20% OFF  (Sizes 750ml & Up)",
                    icon = icon.blue) %>%
  
  addAwesomeMarkers(lat = 29.41889033392752, lng = -98.48798016496877, 
                    label= "Chocollazo Hemisfair, 10% OFF Total Purchase",
                    icon = icon.blue) %>%
  
  addAwesomeMarkers(lat = 29.46352057739082, lng = -98.46566954809337, 
                    label= "Chocollazo, 10% OFF Total Purchase",
                    icon = icon.blue) %>%
  
  addAwesomeMarkers(lat = 29.418940187324097, lng = -98.48799771900897, 
                    label= "Paleteria, 10% OFF",
                    icon = icon.blue) %>%
  
  addAwesomeMarkers(lat = 29.426420103502593, lng = -98.48852796651943, 
                    label= "Playland Pizza,  15% OFF ",
                    icon = icon.blue) %>%
  
  addAwesomeMarkers(lat = 29.42677241585512, lng = -98.48831691796651, 
                    label= "Devil's River Distillery, 10% OFF (All Cocktails)",
                    icon = icon.blue) %>%
  
  addAwesomeMarkers(lat = 29.44086023397055, lng = -98.48519826674521, 
                    label= "Local Moves Studio, 1 FREE Session & 3 Classes $45 ($100 Value!)",
                    icon = icon.blue) %>%
  
  addAwesomeMarkers(lat = 29.415459302304097, lng = -98.48909385350177, 
                    label= "PHARM TABLE, 10% OFF",
                    icon = icon.blue) %>%
  
  addAwesomeMarkers(lat = 29.418689613707883, lng = -98.48705572665915, 
                    label= "Commonwealth Coffee,  10% OFF",
                    icon = icon.blue) %>%

  addAwesomeMarkers(lat = 29.42852459478028, lng = -98.49271448019391, 
                  label= "Commonwealth Coffee,  10% OFF",
                  icon = icon.blue) %>%
  
  addAwesomeMarkers(lat = 29.44255725676988, lng = -98.4965280007015, 
                    label= "Commonwealth Coffee,  10% OFF",
                    icon = icon.blue) %>%
  
  addAwesomeMarkers(lat = 29.46652248274249, lng = -98.46290055671523, 
                    label= "Commonwealth Coffee,  10% OFF",
                    icon = icon.blue) %>%
  
  addAwesomeMarkers(lat = 29.42591828489151, lng = -98.4881506374426, 
                    label= "On The Bend Oyster Bar &  Lounge, 25% OFF (Coffee Products & Pastries)",
                    icon = icon.blue) %>%
  
  addAwesomeMarkers(lat = 29.434824288546633, lng = -98.4841632317058, 
                    label= "Wyndham Garden SA Riverwalk Museum Reach, 10% OFF (At The Restaurant)",
                    icon = icon.blue) %>%
  
  addAwesomeMarkers(lat = 29.43309472822588, lng = -98.484521946736, 
                    label= "Back Unturned Brewing Co, 10% OFF All Purchases",
                    icon = icon.blue) %>%
  
  addAwesomeMarkers(lat = 29.490304267636507, lng = -98.45851547289598, 
                    label= "CryoFit, 15% OFF (Single Services)",
                    icon = icon.blue) %>%
  
  addAwesomeMarkers(lat = 29.41959543873948, lng = -98.4918279780932, 
                    label= "Hyatt Place San Antonio/Riverwalk, 20% OFF",
                    icon = icon.blue)

DTSA_Map