Session Ready
Exercise

Provider Tiles

In the previous exercise, addTiles() added the default OpenStreetMap (OSM) tile to your leaflet map. Map tiles weave multiple map images together. The map tiles presented adjust when a user zooms or pans the map enabling the interactive features you experimented with in exercise 2.

The leaflet package comes with more than 100 map tiles that you can use. These tiles are stored in a list called providers and can be added to your map using addProviderTiles() instead of addTiles().

The leaflet and tidyverse libraries have been loaded for you.

Instructions
100 XP
  • Print the list of 100+ provider tiles that are included in the leaflet package.
  • To make this output more readable, print just the names of the provider tiles using the names() function.
  • Use the str_detect() function from the stringr package to determine which provider tiles include the string "CartoDB".
  • Print the name of every provider map tile that includes the string "CartoDB".