Book Image

Leaflet.js Essentials

Book Image

Leaflet.js Essentials

Overview of this book

Table of Contents (13 chapters)
Leaflet.js Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 2. Mapping GeoJSON Data

In Chapter 1, Creating Maps with Leaflet, all of the geometry elements—points, lines, and polygons—were created one at a time. You learned how to create groups of features using layer and feature groups and also multipolyline and multipolygon classes. In this chapter, you will learn how to add GeoJSON data to your map. The data will be comprised of multiple geometries and will have descriptive data associated with it.

In this chapter, we will cover the following topics:

  • What is GeoJSON?

  • How to add it to your map

  • How to style it

  • Iterating through features

  • How to call GeoJSON from external sources