
Question:
Is it possible to have this exact same functionality in GWT?
layer = new google.maps.FusionTablesLayer({
query: {
select: 'geometry',
from: '1ertEwm-1bMBhpEwHhtNYT47HQ9k2ki_6sRa-UQ'
},
styles: [{
polygonOptions: {
fillColor: '#00FF00',
fillOpacity: 0.3
}
}, {
where: 'birds > 300',
polygonOptions: {
fillColor: '#0000FF'
}
}, {
where: 'population > 5',
polygonOptions: {
fillOpacity: 1.0
}
}]
});
I am trying to implement this: <a href="https://developers.google.com/maps/documentation/javascript/examples/layer-fusiontables-styling" rel="nofollow">https://developers.google.com/maps/documentation/javascript/examples/layer-fusiontables-styling</a>
So far I have managed to implement single style here <a href="https://stackoverflow.com/q/29577659/768894" rel="nofollow">Custom coloring of countries in Google Maps : GWT?</a> but I want to apply conditional styling as in the given javascript code snippet i.e if #ofbirds > 300 then fillColor: '#0000FF'
if #ofbirds > 500 then fillColor: '#0000FE'
Thanks
Answer1:After a lot of painful trial and error I was able to do it. Posting here so that others could benefit.
private native FusionTablesLayer createFusionTableLayer()/*-{
return new $wnd.google.maps.FusionTablesLayer({
query: {
select: 'geometry',
from: '1tJkzVXTv-B2-rFeQVO9bX_vICCvJ9Xq1LU6xog5f'
},
styles: [{
polygonOptions: {
fillColor: '#00FF00',
fillOpacity: 0.3
}
}, {
where: 'birds > 300',
polygonOptions: {
fillColor: '#0000FF'
}
}, {
where: 'population > 5',
polygonOptions: {
fillOpacity: 1.0
}
}]
});
}-*/;