Fusion Tables造型

问题描述 投票:1回答:2

我正在尝试将多种样式应用于Google Fusion Table Layer。

这不会将数组中的所有多边形着色为不同的颜色:

styles: [{
where: 'Cadmio = 3391',
polygonOptions: {
fillColor: '#e60000',
fillOpacity: 1
}
}, 
{
where: 'Cadmio = 1074',
polygonOptions: {
fillColor: '#ffaa00',
fillOpacity: 1
}
},
{
where: 'Cadmio = 370',
polygonOptions: {
fillColor: '#38a800',
fillOpacity: 1
}
},{
where: 'Cadmio = 156',
polygonOptions: {
fillColor: '#74c200',
fillOpacity: 1
}
},{
where: 'Cadmio = 90',
polygonOptions: {
fillColor: '#98e600',
fillOpacity: 1
}
},{
where: 'Cadmio = 71',
polygonOptions: {
fillColor: '#ffff00',
fillOpacity: 1
}
}]
});

最后一个Whereclause不起作用,似乎de javascript代码只接受5个Whereclauses?我能做什么?我也用Fusion表map-view对它进行了风格化,我想用Javascript设置多边形的不透明度。

maps google-fusion-tables
2个回答
1
投票

每张地图限制为5种样式。 https://developers.google.com/maps/documentation/javascript/layers#fusion_table_styles

Styles can only be applied to a single Fusion Tables layer per map. You may apply up to five styles to that layer.

但是,您可以使用Fusion Tables API设置样式并扩展该限制。


0
投票

您可以使用Fusion Table'IN'子句将其着色。我可以用这个为整个澳大利亚州着色。如果您有任何疑问,请告诉我。

© www.soinside.com 2019 - 2024. All rights reserved.