function createThemeFOI()
{
var baseQuery= "select geom, state, WHITE, BLACK, ASIANPI, state_abrv, AMINDIAN, HISPANIC from states";
var theme = "<themes><theme name='MY_JDBC_THEME' >" +
"<jdbc_query spatial_column='geom' jdbc_srid='8307' key_column='state' " +
"render_style='C.COUNTIES' datasource='mvdemo'>" + baseQuery +
"</jdbc_query>"+
"<rendering>"+
" <style name='my_style' value_columns='white,black,asianpi,amindian,hispanic'/>"+
"</rendering>"+
"</theme></themes>" ;
themebasedfoi = new MVThemeBasedFOI('ajdbctheme',theme);
themebasedfoi.setBringToTopOnMouseOver(true);
themebasedfoi.enableImageCaching(false);
mapview.addThemeBasedFOI(themebasedfoi);
}
In the above, we are defining a JDBC theme-based FOI layer. Note the element <rendering> and its sub-elements. This is how we can
explicitly specify which (value) columns should be used by which style. In this case, the 5 race columns are associated with the style
named "my_style", which is a dynamically created pie chart style. This custom rendering rule will override the theme's existing
rendering style(s), which is C.COUNTIES in this example.