map.addLayer(new Google("Google Layer", toMap(pair(
"sphericalMercator", true))));
// prepare to style the data
StyleMap styleMap = new StyleMap(toMap(pair("strokeColor", "black"),
pair("strokeWidth", 2), pair("strokeOpacity", 0.5),
pair("fillOpacity", 0.2)));
// create a color table for state FIPS code
String[] colors = new String[] { "red", "orange", "yellow", "green",
"blue", "purple" };
String code;
Map<String, Map<String, String>> fips = new HashMap<String, Map<String, String>>();
for (int i = 1; i <= 66; ++i) {
code = "0" + i;
code = code.substring(code.length() - 2);
fips.put(code, toMap(pair("fillColor", colors[i % colors.length])));
}
// add unique value rules with your color lookup
styleMap.addUniqueValueRules("default", "STATE_FIPS", fips, null);
// create a vector layer using the canvas renderer (where available)
map.addLayer(new Vector(
"States",
toMap(pair("strategies", new Object[] { new BBOX() }),