From the course: Creating Maps with R
Unlock the full course today
Join today to access over 24,200 courses taught by industry experts.
Add labels and pop-ups to Leaflet maps
From the course: Creating Maps with R
Add labels and pop-ups to Leaflet maps
- [Instructor] Interactive maps are really awesome because they allow us to provide additional information to readers when they interact with the map. In a leaflet package we have two different ways to add this kind of information with labels and popups. Labels appear when a user hovers their cursor over a feature in a map, whereas popups show when a user deliberately clicks a feature in a map. These kinds of interactions were all built decades before touchscreen devices were even a consideration. Today, we need to think about how the interactive maps we build will work on mobile devices. There simply is no difference on a touchscreen between hovering or clicking a map. The simplest advice I can give you is to avoid combining both labels and popups in the same leaflet map. It's also important to note that you can only customize the appearance of popups with HTML. It's not possible to do so with hover labels in the…
Contents
-
-
-
-
-
-
-
The basics of using Leaflet2m 57s
-
(Locked)
Use Leaflet to visualize geo locations5m 41s
-
(Locked)
Add labels and pop-ups to Leaflet maps5m 6s
-
(Locked)
Leaflet choropleth and continuous data6m 17s
-
(Locked)
Leaflet choropleth and discontinuous data6m 3s
-
(Locked)
Set a background color with leaflet.extras1m 25s
-
(Locked)
Challenge: Add pop-up labels to a map of German cities35s
-
(Locked)
Solution: Add pop-up labels to a map of German cities6m 4s
-
(Locked)
Challenge: Interactive choropleth of state coastline length39s
-
(Locked)
Solution: Interactive choropleth of state coastline length6m 20s
-
-
-