5 Leaflet plugins to spice up your map

The beauty of open source software is that developers can add to existing code to make life easier for other developers. Leaflet allows users to develop neat additions to your web map called ‘plugins’. The very best plugins are showcased on the Leaflet website. Over time though, even this list has gotten large (which is a good thing). Today we will look at the five most useful plugins that you might want to add to your Leaflet web map.

1. Draw

This plugin made by Jacob Toye allows you to draw all kinds of shapes on your map. Useful for sketching out custom features such as paths, areas and boundaries.

2. Providers

As the name suggests, you can add map tiles from various providers with this plugin without much of a hassle. You can add map tiles from providers such as ESRI, HERE (Nokia) and MapBox with ease with this plugin.

3. Search

When you have tons of uniquely named markers on your map, finding the right marker can be a bother. This nifty plugin by Stefano Cudini adds a search box for your markers, so your markers don’t get lost in the crowd.

4. Marker Clustering

This plugin by Dave Leaver groups nearby markers into neat, colour-coded clusters. This plugin is by far one my most favourites and one that I just love to use solely because it is simple, highly functional and makes your map look beautiful. I could not recommend this plugin highly enough.

5. Routing

This plugin by the Norwegian Trekking Association is especially useful when you are using the OSM road network and want to provide shortest routes and directions on your map.

These were five highly useful Leaflet plugins you can use to add more functionality to your map. If you have your own plugins that you would like to highlight or have your own list of useful plugins, please do mention them in your comment!

Advertisements

Mapping Pollution in India

Photo credit: Alfred Palmer / Foter.com / Public domain

Pollution is an inevitable by-product of industrial growth. It is important, however, to understand the quantity of pollution created by an industrial area and the subsequent impact on the local environment and population. The Central Pollution Control Board (CPCB), in association with IIT-Delhi, has devised a way to rationalize the amount of pollution in an area, called the Comprehensive Environmental Pollution Index (CEPI).

CEPI takes into account the presence of toxins, the scale of industrial activity, the concentration of  pollutants, the impact on people and the eco-geology, the level of exposure and the risk to sensitive receptors. These factors are classified into pollutant, pathway and receptor. Based on the score obtained by the area in the three factors, the index is calculated to determine the amount pollution in that area. This index is then used as a basis for further action to be taken to rein in the problematic areas and mitigate further damage.

The Government of India released the results of this study over three iterations (2009, 2011 and 2013) in the public domain. This dataset contains information about 43 critically polluted areas in India. I superimposed the results of this study upon location and created an interactive map to better understand the extent of the study.

pollution_map
Map of the CEPI scores of industrial sectors across India. The markers in red indicate the presence of a moratorium in the area, while the blue markers indicate that the moratorium has been lifted.

You can check out the map here: http://mapyogi.com/apps/pollution/

To create the basemap, I used the OpenStreetMap customization tools provided by Mapbox. LeafletJS was used to overlay the data on the basemap and provide interactivity. Twitter Bootstrap was used to make the map and the web page responsive.

The CEPI is a move in the right direction. Let’s hope that this study is consistently improved upon in the future, to give some hope of preserving our rapidly deteriorating environment.

You can know more about CEPI, CPCB and the data released here:

  1. http://cpcb.nic.in/divisionsofheadoffice/ess/NewItem_152_Final-Book_2.pdf
  2. http://cpcb.nic.in/
  3. http://data.gov.in/dataset/details-comprehensive-environmental-pollution-index-cepi-scores-and-status-moratorium-critic
  4. http://pib.nic.in/newsite/erelease.aspx?relid=59156