我有一个suppressInfoWindows的问题,它在地图选项中声明时似乎不能在我的地图上工作。任何想法
function updateLayerQuery(layer, sector, county) {
var where = "Sector = '" + sector + "'";
if (county) {
where += " AND County = '" + county + "'";
}
layer.setOptions({
query: {
select: 'geometry',
from: '1xeq1_MLccx-A2spFLz_nc35xQwsBZNhwgGnUn1wY',
where: where,
suppressInfoWindows: true
}
CodePen上的完整代码http://codepen.io/PiotrKrosniak/pen/VaEbBa
答案 0 :(得分:1)
suppressInfoWindows
是FusionTableLayersOptions对象的属性,而不是FusionTablesQuery对象的属性。
function updateLayerQuery(layer, sector, county) {
var where = "Sector = '" + sector + "'";
if (county) {
where += " AND County = '" + county + "'";
}
layer.setOptions({
suppressInfoWindows: true, // should be here
query: {
select: 'geometry',
from: '1xeq1_MLccx-A2spFLz_nc35xQwsBZNhwgGnUn1wY',
where: where,
}