【发布时间】:2013-12-28 11:55:14
【问题描述】:
我通过 Google Maps API 使用查询来过滤来自 Google Fusion Table 的功能。这段代码效果很好:
var column = getColumn();
layer = new google.maps.FusionTablesLayer({
suppressInfoWindows: true,
query: {
select: 'geometry',
from: tableno
},
styles: [{
polygonOptions: {
fillOpacity: 0.8,
strokeColor: '#000000',
strokeOpacity: 0.2,
strokeWeight: 2
}
}, {
where: "'$fool' <= '5.24'".replace('$fool', column),
polygonOptions: {
fillColor: '#FEE5D9'
}
}, {
where: "'$fool' > '5.24'".replace('$fool', column),
polygonOptions: {
fillColor: '#FCAE91'
}
}, {
where: "'$fool' > 5.83".replace('$fool', column),
polygonOptions: {
fillColor: '#FB6A4A'
}
}, {
where: "'$fool' > 6.49".replace('$fool', column),
polygonOptions: {
fillColor: '#DE2D26'
}
}, {
where: "'$fool' > 7.37".replace('$fool', column),
polygonOptions: {
fillColor: '#A50F15'
}
}]
});
问题是,我无法添加另一个类。如果我添加类似
{
where: "'$fool' = '0'".replace('$fool', column),
polygonOptions: {
fillColor: '#ffffff'
}
},
仅呈现前 3-4 个类。以下所有功能都将在最后(第 3/4)类中着色。
当我想突出显示所选功能时,这会变得更加严重,我会在其中创建另一个查询
var NumVal = e.row['name'].value;
额外的课程
{
where: "'name' = " + NumVal,
polygonOptions: {
strokeColor: '#88d32f',
strokeOpacity: 1,
strokeWeight: 4
}
},
突然只使用了这个和下面的类。所有功能仅在以下类别中着色。
有人可以帮忙吗?为什么添加其他类时突然忽略查询/类?
【问题讨论】:
标签: google-maps google-maps-api-3 filtering google-fusion-tables