From the course: Creating Maps with R
Unlock the full course today
Join today to access over 24,200 courses taught by industry experts.
Use Leaflet to visualize geo locations
From the course: Creating Maps with R
Use Leaflet to visualize geo locations
- Let's use leaflet to visualize geolocation using the script in the 05_02b project. I'm going to run lines 15 through to one. So that's going to load our packages and define our two data sets. And line 17 through 23, I've started our map off, which is going to include just a border for Brazil. Let's start with a geo marker plot. So let's add a pipe at the end of line 23, and we'll type addMarkers. We'll add the data argument, and we will provide brazil_cities. And that adds our locations as teardrop icons that you'll be familiar with from services like Google Maps. There's not much that we can do to customize these maps, so let's swap this geo marker plot for geo scatter plot by changing addMarkers into addCircleMarkers. So these circles both have a fill color and they have a border as well. Let's change the width of the border, which is currently quite wide, by adding the argument, weight is equal to one. Let's…
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
-
-
-