选择标记时外部化 Google 地图 InfoWindow 内容
我想知道是否有人知道当单击地图上的标记时是否可以获取 Google 地图 InfoWindow 的内容并将其放置在外部 DIV 中?
我对 API 文档和 Google 进行了深入研究,看看是否能找到与此相关的任何示例或信息,但到目前为止还没有运气。然而,自从我被问到这个问题以来,我并没有太多的时间,所以我不得不略读一下,所以我可能错过了一些东西,但似乎没有什么能引起我的注意。
本质上,我只是想知道这是否确实可能,这样我就不会再浪费时间研究目前 Google 地图无法实现的东西。然而,如果有人有任何代码、示例或关于如何执行此操作的想法,那么我们将非常感激!
谢谢,
马克
I'm wondering if anyone knows whether it is possible to take the content of a Google Maps InfoWindow and place it in an external DIV when the marker on the map is clicked?
I've had a good dig around both the API docs and Google to see if I can find any examples or information relating to this but have had no luck so far. However I've not had a lot of time since I got asked about this one so I have had to skim a bit so it could be that I've missed something but nothing seems to be jumping out at me.
Essentially I'd just like to know if this is indeed possible so that I don't waste anymore time researching something that is currently not possible with Google Maps. However if anyone has any code, examples, or ideas about how to go about doing this then that would be a very much appreciated!
Thanks,
Mark
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这绝对是可能的。只需将每个标记以及您想要显示的任何数据添加到数组中即可。向每个标记添加一个侦听器,该侦听器将在单击标记时访问该数据。
请参阅以下问题:
It's definitely possible. Just add each marker to an array, along with whatever data you want to display. Add a listener to each marker which will access that data when the marker is clicked.
See these questions: