1. Learn
  2. /
  3. Courses
  4. /
  5. Building Dashboards with shinydashboard

Connected

Exercise

Creating your first leaflet map

You have seen how leaflet maps can be created as a collection of different layers.

There are also other settings that can allow users to select specific layers and map providers.

In this exercise, you will create your own leaflet map with various features.

There are four sf objects stored here as:

  • london_poly
  • london_loop
  • london_capital
  • listings_geo

You can look at the geometry attribute of each sf object with the $geometry notation.

The sf, tidyverse and leaflet libraries have been loaded.

Instructions

100 XP
  • Add another provider called Esri.WorldStreetMap.
  • Add red polygons.
  • Fill up addLayersControl() so that different overlay groups and layers can be selected by the user, adding them in their order of appearance.