albertsun/gmap-features — pull request #1 by jsoma (2011-11-09 00:58:02+00:00)
Title: Callbacks for polygon styling

Added dynamic polygon styling code for unselected, selected and highlighted - for example, instead of just passing in a hash like

highlighted_opts: {
strokeWeight: 2.0,
strokeColor: "#000000"
},

you can also add in

responsive_highlighted_opts: function() {
if(this.fields.totpop_wnh > 100) {
return { fillColor: "#8DEE00" };
} else {
return { fillColor: "#EE1200" };
}
}
}

and have it pick the fill color based on the value of `totpop_wnh`.

`responsive_unselected_opts` is kind of a more complete getColor.

Also cleaned up the redrawing of a feature a bit, popped all the code into one spot.