Fusion表suppressInfoWindows无法正常工作

时间:2016-04-28 14:08:19

标签: google-maps-api-3 google-fusion-tables

我有一个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

1 个答案:

答案 0 :(得分:1)

suppressInfoWindowsFusionTableLayersOptions对象的属性,而不是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,
      }