Make the leaflet and readr packages available.
library(leaflet)
library(readr)
Rerun the code from Problem 2 in the previous assignment.
mylocs<-read_csv("my_locs.csv")
##
## -- Column specification --------------------------------------------------------
## cols(
## lon = col_double(),
## lat = col_double(),
## id = col_character()
## )
myMap<-mylocs%>%
leaflet()%>%
addTiles()%>%
addMarkers(popup = ~id)
## Assuming "lon" and "lat" are longitude and latitude, respectively
myMap
Rerun the code again with a different provider’s tiles.
myMap<-mylocs%>%
leaflet()%>%
addProviderTiles("CartoDB.VoyagerLabelsUnder")%>%
addMarkers(popup = ~id)
## Assuming "lon" and "lat" are longitude and latitude, respectively
myMap
Do that again with a different provider.
myMap<-mylocs%>%
leaflet()%>%
addProviderTiles("CartoDB.Voyager")%>%
addMarkers(popup = ~id)
## Assuming "lon" and "lat" are longitude and latitude, respectively
myMap
names(providers)
## [1] "OpenStreetMap"
## [2] "OpenStreetMap.Mapnik"
## [3] "OpenStreetMap.DE"
## [4] "OpenStreetMap.CH"
## [5] "OpenStreetMap.France"
## [6] "OpenStreetMap.HOT"
## [7] "OpenStreetMap.BZH"
## [8] "OpenSeaMap"
## [9] "OpenPtMap"
## [10] "OpenTopoMap"
## [11] "OpenRailwayMap"
## [12] "OpenFireMap"
## [13] "SafeCast"
## [14] "Thunderforest"
## [15] "Thunderforest.OpenCycleMap"
## [16] "Thunderforest.Transport"
## [17] "Thunderforest.TransportDark"
## [18] "Thunderforest.SpinalMap"
## [19] "Thunderforest.Landscape"
## [20] "Thunderforest.Outdoors"
## [21] "Thunderforest.Pioneer"
## [22] "Thunderforest.MobileAtlas"
## [23] "Thunderforest.Neighbourhood"
## [24] "OpenMapSurfer"
## [25] "OpenMapSurfer.Roads"
## [26] "OpenMapSurfer.Hybrid"
## [27] "OpenMapSurfer.AdminBounds"
## [28] "OpenMapSurfer.ContourLines"
## [29] "OpenMapSurfer.Hillshade"
## [30] "OpenMapSurfer.ElementsAtRisk"
## [31] "Hydda"
## [32] "Hydda.Full"
## [33] "Hydda.Base"
## [34] "Hydda.RoadsAndLabels"
## [35] "MapBox"
## [36] "Stamen"
## [37] "Stamen.Toner"
## [38] "Stamen.TonerBackground"
## [39] "Stamen.TonerHybrid"
## [40] "Stamen.TonerLines"
## [41] "Stamen.TonerLabels"
## [42] "Stamen.TonerLite"
## [43] "Stamen.Watercolor"
## [44] "Stamen.Terrain"
## [45] "Stamen.TerrainBackground"
## [46] "Stamen.TerrainLabels"
## [47] "Stamen.TopOSMRelief"
## [48] "Stamen.TopOSMFeatures"
## [49] "TomTom"
## [50] "TomTom.Basic"
## [51] "TomTom.Hybrid"
## [52] "TomTom.Labels"
## [53] "Esri"
## [54] "Esri.WorldStreetMap"
## [55] "Esri.DeLorme"
## [56] "Esri.WorldTopoMap"
## [57] "Esri.WorldImagery"
## [58] "Esri.WorldTerrain"
## [59] "Esri.WorldShadedRelief"
## [60] "Esri.WorldPhysical"
## [61] "Esri.OceanBasemap"
## [62] "Esri.NatGeoWorldMap"
## [63] "Esri.WorldGrayCanvas"
## [64] "OpenWeatherMap"
## [65] "OpenWeatherMap.Clouds"
## [66] "OpenWeatherMap.CloudsClassic"
## [67] "OpenWeatherMap.Precipitation"
## [68] "OpenWeatherMap.PrecipitationClassic"
## [69] "OpenWeatherMap.Rain"
## [70] "OpenWeatherMap.RainClassic"
## [71] "OpenWeatherMap.Pressure"
## [72] "OpenWeatherMap.PressureContour"
## [73] "OpenWeatherMap.Wind"
## [74] "OpenWeatherMap.Temperature"
## [75] "OpenWeatherMap.Snow"
## [76] "HERE"
## [77] "HERE.normalDay"
## [78] "HERE.normalDayCustom"
## [79] "HERE.normalDayGrey"
## [80] "HERE.normalDayMobile"
## [81] "HERE.normalDayGreyMobile"
## [82] "HERE.normalDayTransit"
## [83] "HERE.normalDayTransitMobile"
## [84] "HERE.normalDayTraffic"
## [85] "HERE.normalNight"
## [86] "HERE.normalNightMobile"
## [87] "HERE.normalNightGrey"
## [88] "HERE.normalNightGreyMobile"
## [89] "HERE.normalNightTransit"
## [90] "HERE.normalNightTransitMobile"
## [91] "HERE.reducedDay"
## [92] "HERE.reducedNight"
## [93] "HERE.basicMap"
## [94] "HERE.mapLabels"
## [95] "HERE.trafficFlow"
## [96] "HERE.carnavDayGrey"
## [97] "HERE.hybridDay"
## [98] "HERE.hybridDayMobile"
## [99] "HERE.hybridDayTransit"
## [100] "HERE.hybridDayGrey"
## [101] "HERE.hybridDayTraffic"
## [102] "HERE.pedestrianDay"
## [103] "HERE.pedestrianNight"
## [104] "HERE.satelliteDay"
## [105] "HERE.terrainDay"
## [106] "HERE.terrainDayMobile"
## [107] "FreeMapSK"
## [108] "MtbMap"
## [109] "CartoDB"
## [110] "CartoDB.Positron"
## [111] "CartoDB.PositronNoLabels"
## [112] "CartoDB.PositronOnlyLabels"
## [113] "CartoDB.DarkMatter"
## [114] "CartoDB.DarkMatterNoLabels"
## [115] "CartoDB.DarkMatterOnlyLabels"
## [116] "CartoDB.Voyager"
## [117] "CartoDB.VoyagerNoLabels"
## [118] "CartoDB.VoyagerOnlyLabels"
## [119] "CartoDB.VoyagerLabelsUnder"
## [120] "HikeBike"
## [121] "HikeBike.HikeBike"
## [122] "HikeBike.HillShading"
## [123] "BasemapAT"
## [124] "BasemapAT.basemap"
## [125] "BasemapAT.grau"
## [126] "BasemapAT.overlay"
## [127] "BasemapAT.highdpi"
## [128] "BasemapAT.orthofoto"
## [129] "nlmaps"
## [130] "nlmaps.standaard"
## [131] "nlmaps.pastel"
## [132] "nlmaps.grijs"
## [133] "nlmaps.luchtfoto"
## [134] "NASAGIBS"
## [135] "NASAGIBS.ModisTerraTrueColorCR"
## [136] "NASAGIBS.ModisTerraBands367CR"
## [137] "NASAGIBS.ViirsEarthAtNight2012"
## [138] "NASAGIBS.ModisTerraLSTDay"
## [139] "NASAGIBS.ModisTerraSnowCover"
## [140] "NASAGIBS.ModisTerraAOD"
## [141] "NASAGIBS.ModisTerraChlorophyll"
## [142] "NLS"
## [143] "JusticeMap"
## [144] "JusticeMap.income"
## [145] "JusticeMap.americanIndian"
## [146] "JusticeMap.asian"
## [147] "JusticeMap.black"
## [148] "JusticeMap.hispanic"
## [149] "JusticeMap.multi"
## [150] "JusticeMap.nonWhite"
## [151] "JusticeMap.white"
## [152] "JusticeMap.plurality"
## [153] "Wikimedia"
## [154] "GeoportailFrance"
## [155] "GeoportailFrance.parcels"
## [156] "GeoportailFrance.ignMaps"
## [157] "GeoportailFrance.maps"
## [158] "GeoportailFrance.orthos"
## [159] "OneMapSG"
## [160] "OneMapSG.Default"
## [161] "OneMapSG.Night"
## [162] "OneMapSG.Original"
## [163] "OneMapSG.Grey"
## [164] "OneMapSG.LandLot"
Which provider looks best to you? No code, just write.
It looks like OpenStreet Map is one of the best providers to use out of the three I tried here. The default open street map has more detail, which can be useful for many different audiences. I see more detail in the overlays for highways, streets, buildings, land use, and even ferry routs.