是否可以在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
}
}]
});
我正在努力实现这一点:https://developers.google.com/maps/documentation/javascript/examples/layer-fusiontables-styling
到目前为止,我已设法在此处实现单一样式Custom coloring of countries in Google Maps : GWT?但我想在给定的javascript代码片段中应用条件样式,即#ofbirds> 300然后fillColor: '#0000FF'
如果#ofbirds> 500然后fillColor: '#0000FE'
由于
答案 0 :(得分:2)
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
}
}]
});
}-*/;