Exploring Leaflet Vector Classes


This post, third in my series on the Leaflet API, explores the vector classes. Vector graphics are primitive geometric shapes that easily scale across pixel resolutions, such as points, lines, circles, and polygons. The point class, L.LatLon was covered in my previous post, Exploring Leaflet Geographic Classes. The remaining vector classes are shown below.

Leaflet Vector Classes

Leaflet Vector Classes

As was the case with the geographic classes, there are similar vector classes available in all online map APIs.

Not pictured above are L.MultiPolyline and L.MultiPolygon, as those are contained in L.FeatureGroup, which extends L.LayerGroup, which I will covered later in my series. I included L.PolyUtil and L.LineUtil because they have some helpful functions, such as Douglas-Peuker line simplification, distance and proximity calculations, and clipping.

A picture is worth a 1,000 words, so I’m not going to expand on my diagram. You can read more in the Leaflet API documentation.

Next stop, raster classes.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s