0

我在示例网站上有一个正常工作的应用程序

我想将所选线的显示从默认的细红线更改为更粗的绿色(或红色)线。

当我更改 map.js 文件中的以下代码时

// Google Fusion LineFeat table
var linLayer = new google.maps.FusionTablesLayer({
    query: {
        select: 'name',
          from: linTableId,
      where: idStr,
      },
      map: GlobalMap
    });

如图所示添加样式部分,显示中没有任何变化

// Google Fusion LineFeat table
var linLayer = new google.maps.FusionTablesLayer({
    query: {
        select: 'name',
          from: linTableId,
      where: idStr,
      styles: [{
        polylineOptions: {
            strokeColor: "#00FF00",
            strokeWeight: "12"
        }
        }]
      },
      map: GlobalMap
    });

有人可以为我可能做错的事情提供一些指导吗?如果我注释掉对将地图缩放到特定项目中的 zoom.js 函数的调用,我会得到相同的结果。

4

1 回答 1

0

样式选项不在查询中:

// Google Fusion LineFeat table
var linLayer = new google.maps.FusionTablesLayer({
    query: {
        select: 'name',
        from: linTableId,
        where: idStr
    },
    styles: [{
        polylineOptions: {
          strokeColor: "#00FF00",
          strokeWeight: "12"
        }
    }],
    map: GlobalMap
  });

顺便说一句 - 在您的“示例地图”中,您正在用 AreaFeat 的图层覆盖 linLayer,您可能不希望这样。

于 2013-05-21T18:06:28.780 回答