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 map = new GMap2(document.getElementById("map"));
    map.enableScrollWheelZoom();
    map.setCenter(new GLatLng(18, 0), 2);
    map.addControl(new GLargeMapControl());
    map.addControl(new GHierarchicalMapTypeControl());
    map.setMapType(G_PHYSICAL_MAP)

    var countyData = [];
    for( var code in Cartographer.regions ) { 
	 if( code.indexOf("US") != 0 ) { 
        countyData.push( { region:code, val:code.charCodeAt(4) } ); 	
      }
    }

    var cartographer = Cartographer( map, { colorize:"#000", colorizeAlpha:.3 } );
    cartographer.choropleth(countyData, { colorScheme:"YlOrRd"});

See also the basic demo or the advanced choropleth demo.