【问题标题】:Fusion Table and Google Maps API: Only first classes are used for rendering featuresFusion Table 和 Google Maps API:只使用第一类来呈现特征
【发布时间】: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


    【解决方案1】:

    根据“限制”下的documentation,您只能对一个FusionTablesLayer应用5个样式规则:

    您可以使用 Maps API 将最多五个 Fusion Tables 图层添加到地图中,其中一个最多可以设置五个样式 样式规则

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-04-26
      • 2015-03-06
      • 2013-01-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-29
      • 2013-10-25
      相关资源
      最近更新 更多