Putting it All Together
1. Putting it All Together
We've covered a lot of material in the course and made some neat maps along the way. In this final section, you'll have an opportunity to pull a lot of our work together into a single interactive leaflet map.2. Review
First, let's take a look back at what we've learned. We've used leaflet and html widgets to plot multiple base maps with color coded markers and polygons. Additionally, we have used base and overlay groups to enhance the interactive elements of our maps and we explored a number of useful features available in the leaflet extras package. Now we’ll create a single map that plots both points and polygons.3. Putting it all Together
Starting from scratch, we'll call the leaflet() function, add three base maps with corresponding group names, then, we'll add our zip code polygons,4. Putting it all Together
followed by our circle markers for public, private, and for-profit institutions complete with group names and labels. Finally, we add our layer controls to enable users to toggle between base maps and to show or hide overlay groups.5. Putting it all Together
This yields an interactive map that has both points and polygons with labels and layers that users can explore. For example, if we were interested in learning more about the mean income in areas surrounding public colleges, we could quickly change the visible layers to investigate this topic. In the final set of exercises, you'll work toward creating a similar map that displays all of four-year colleges in the United States as well as the most affluent zip codes in the country.6. Saving a Map
We've put a lot of work into creating this map, we should save it, so we can use the map later and maybe post it to a web site. We can save leaflet maps from the console using the htmlwidgets package. After storing a leaflet map in an object, the saveWidget() function allows us to write the map to an html file that we can store locally or on a server.7. Let's practice!
Now it's time for you to put all of this work into practice.Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.