Lucas Young
25 November 2020
Load packages:
library(leaflet)
library(dplyr)
Build data frame:
GolfCourses <- data.frame(GolfCourse = c('Rose Creek', 'Edgewood', 'Osgood', 'Prairiewood', 'El Zagal'),
Latitude = c(46.8103690184923,
46.928241651106944,
46.815033910787676,
46.85352938524547,
46.895244463915944),
Longitude = c(-96.80988014102991,
-96.7667322463574,
-96.89025249053951,
-96.82043000004329,
-96.7775773635527))
GolfCourses %>%
leaflet() %>%
addTiles(urlTemplate = "http://mt0.google.com/vt/lyrs=m&hl=en&x={x}&y={y}&z={z}&s=Ga",
attribution = 'Google') %>%
addMarkers(~Longitude,
~Latitude,
label = ~GolfCourse,
labelOptions = labelOptions(direction = 'left', style = list('font-size' = '12px')))