【问题标题】:Google Map API - Fusion Table Layer not showing in ChromeGoogle Map API - 融合表层未在 Chrome 中显示
【发布时间】:2015-03-10 17:40:09
【问题描述】:

我使用 API 和 Fusion Table 中的数据创建了 Google 地图。它在 Firefox 中运行良好,但在 Chrome 中不显示图层样式(多边形)。它似乎在那里,因为它是可点击的……等等。如果我缩放和平移它最终会出现。

layer = new google.maps.FusionTablesLayer({
map: map,
heatmap: { enabled: false },
suppressInfoWindows: true,
query: {
 select: "col2\x3e\x3e0",
 from: FusionTableID,
 where: ""
  },
  options: {
    styleId: 2,
    templateId: 3
  }

});

layer.setMap(map);

【问题讨论】:

  • 无法根据给定的代码回答,可能是CSS-issue

标签: google-maps google-chrome google-fusion-tables


【解决方案1】:

找到这个帖子,它似乎已经解决了这个问题! Google Maps JS APi v3 fusion table layer is not working in Chrome

需要添加这个样式:

 #map-canvas img{max-width:none;}

【讨论】:

  • 这里的确切问题让我很生气 - 网络显示了从 web 服务返回的融合表数据,控制台中没有任何异常。我有一个设计者友好的开发环境设置(没有网络服务器,编译 JSX 和更少的浏览器),只在 Firefox 上工作,所以假设它不起作用,因为我在转换到新环境时破坏了一些东西。事实证明,当您的主题将 img 设置为“max-width: 100%”时会发生这种情况,因为地图 img 的包含元素是 0x0,并且图像在技术上是溢出的。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-08-02
  • 2013-11-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多