打开 Google 地图上的所有 InfoWindows

发布于 12-28 01:59 字数 408 浏览 3 评论 0原文

我知道有一个关于此的非常类似的问题,但问题是仍未解决,似乎是人们可能想要的一件微不足道的事情:对于给定的 Google 地图,数据来自 Fusion Tables 图层,我想同时打开所有 InfoWindows(工具提示)。

目前,您可以通过单击地图上的每个区域来单独打开它们。期望的结果就像在它们停留在周围时将它们全部单击(不让它们彼此靠近)。

我的目标是显示地图,其中所有这些信息都可见,而不需要任何交互。我不知道在 Google 地图中显示标签的更简单方法,但我很高兴听到其他方法来实现它。此时,我决定不让每个 InfoWindow 关闭其余的,这样我就可以手动依次打开它们。

I know there's a very similar question about this, but the problem is still unresolved and seems like such a trivial thing one may want: for a given Google Map, with data coming from a Fusion Tables layer, I'd want to open all InfoWindows (tooltips) simultaneously.

Currently, you can open them individually by clicking each region on the map. The desired result would be like clicking them all while they stick around (not letting them close each other).

My goal is to show the map with all this information visible, not needing any interaction. I'm not aware of an easier way of showing labels in Google Maps, but I'd be delighted to hear another ways to approach it. At this point, I'd settle for not letting each InfoWindow close the rest, so then I could manually open them one after another.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

蓝礼2025-01-04 01:59:24

没有直接的方法可以做到这一点,因为 FusionTableLayer 不会公开数据的底层结构,直到您单击某个功能。

根据表中的行数,您可以使用 Google Chart Tools 直接加载表(最多 500 行),并根据返回的数据生成您自己的信息窗口。这对于点数据来说很容易,但对于多边形或多段线来说就不那么容易了,因为您必须确定信息窗口的放置位置。如果您的表使用地理编码数据,您将必须重新对其进行地理编码。如果它使用 KML,您将必须解析每行中的各个 KML 功能以确定信息窗口的放置位置。

所以,这是可行的,但并不容易。

There's not a direct way to do this as the FusionTableLayer doesn't expose the underlying structure of the data until you click on a feature.

Depending on the number of rows in the table, you could use Google Chart Tools to load the table directly, up to 500 rows, and generate your own infowindows based on the data returned. That is easy for point data, not as easy for polygons or polylines as you have to determine where to place the infowindow. And if you table uses geocoded data you will have to re-geocode them. If it uses KML you will have to parse the individual KML features in each row to determine where to place the infowindow.

So, it's doable but not super easy.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文