Cartographer.js

Choropleth Demo

To build a choropleth map, build an array of objects that contain region and val attributes. Color choices will be determined automatically based on the color scheme and values you specify.

var cartographer = new Cartographer(map);
cartographer.choropleth([
  {region:"US-MN",val:6},
  {region:"US-IA",val:10},
  {region:"US-WI",val:8},
  {region:"US-SD",val:7},
  {region:"US-ND",val:9},
  {region:"US-MI",val:12}
 ], { colorScheme:"BuPu"});

Currently, US states and counties are supported. For states, use the USA country-level ISO 3166-1 two-letter code US followed by the ISO 3166-2 state level code.

See also the counties demo or the state populations demo.