我正在参考我之前的一个问题写作,这也与在谷歌地图中使用Fusion表格层的Where子句有关。 Link to earlier question.我注意到如果样式部分中的Where子句中有多个过滤条件,则会完全忽略它。然后,Google Map / Fusion Tables图层最终将该Style应用于该Fusion表中包含的所有功能。您可以从Where子句中删除过滤条件,使其成为单个过滤器where子句,然后按预期工作,因此我很确定它不喜欢SAME where子句中的多个过滤条件(或者我的方式)写它)。
以下是一个说明此行为的示例:
layer = new google.maps.FusionTablesLayer({
map: map,
options: {
templateId: 2
},
heatmap: { enabled: false },
query: {
select: "geometry",
from: "1D6d93-0iT2zUCw8IvkbpDPYDx2-jA0ZAWXi07mQD",
},
styles: [{
//note multiple filters in the same Where clause.
where: "((SHIFT_ID != 1) AND (SHIFT_ID != 2))",
//you'd expect the following Style option applied to only those map features
//which met above criteria. However, they are applied to ALL map features.
polylineOptions: {
strokeOpacity: 0.70,
strokeColor: "#FFFFFF",
strokeWeight: "5" }
//if Where clause is reduced to just having one filter, it works fine.
//For example, either of the following two work fine by themselves.
//where: "SHIFT_ID != 1" --OR--
//where: "SHIFT_ID != 2" etc.
}]
});
答案 0 :(得分:0)
Geocodezip是对的;查询无效。
这是我能够确定重新使用Fusion Tables的查询。
https://developers.google.com/fusiontables/docs/v2/sql-reference