样式未应用于Google Fusion表层
Style not being applied to Google Fusion Table Layer
我有一个方法可以查询状态边界的一个公共Fusion表。我想做的是用不同的颜色突出显示威斯康星州,并改变伊利诺伊州的填充级别。这是代码:
layer = new google.maps.FusionTablesLayer(531237, {
query: "select geometry from 531237 WHERE STATE_ABBR in (" + states + ") " ,
styles: [
{ where: "STATE_ABBR = 'WI'", polygonOptions: { fillColor: "#0000FF" } },
{ where: "STATE_ABBR = 'IL'", polygonOptions: { fillOpacity: 1.0} }
]
});
layer.setMap(map);
当查询返回时,威斯康星州和伊利诺伊州的高亮显示颜色与其他所有州相同。我的风格有语法错误吗?
您想要更像这样的东西:
layer = new google.maps.FusionTablesLayer({
query: {
select: 'geometry',
from: '531237',
where: "STATE_ABBR in (" + states + ") "
},
styles: [
{ where: "STATE_ABBR = 'WI'", polygonOptions: { fillColor: "#0000FF" } },
{ where: "STATE_ABBR = 'IL'", polygonOptions: { fillOpacity: 1.0} }
]
});
相关文章:
- 未捕获错误:Google Fusion表上的列索引无效
- 如何自动将Fusion Widgets导出为图像
- Google Fusion Table Javascript UPDATE Query?
- 与 Fusion Charts 和 JQWidgets 冲突的 Javascript 库
- 如何在Fusion表中切换不同的层
- 如何从SQL API代码迁移到Google Fusion Table API v1
- Google Fusion API和显示所有数据的问题
- 从SQL API迁移到Fusion Tables v1
- 用于Google Fusion Table层的Javascript工作,但试图整理代码
- Google Maps JS APi v3 融合表层在 Chrome 中不起作用
- Fusion Charts, from flash to pure javascript
- 如何使用 Google Maps API v3 和 Fusion Tables 打开/关闭图层
- 从 Google Fusion Tables on Click 事件中访问单个单元格值
- 关闭/打开 Google Fusion Layer (Google Javascript API v3)
- 融合表层适用于示例,但不适用于我自己的表格
- Fusion Charts setCurrentRenderer('javascript') issue
- Javascript v3 Fusion Table Layer - ROWID in where clause
- "其中“;在谷歌地图的Fusion表层中被忽略的子句
- 样式未应用于Google Fusion表层
- 在执行Fusion表层查询时使用jQuery