gpt4 book ai didi

javascript - Google map - 让信息窗口显示?

转载 作者:行者123 更新时间:2023-11-29 22:26:48 24 4
gpt4 key购买 nike

我目前已成功显示 Google map ,它看起来像这样:

enter image description here

我希望它与默认显示的信息窗口一起显示,就像这个例子:

enter image description here

我读了这个页面:http://code.google.com/apis/maps/documentation/javascript/overlays.html#InfoWindows但这似乎只解释了如何使用您自己的自定义内容制作信息窗口。我只想像上面的示例一样显示您在许多网站上看到的信息。

最佳答案

您可以使用 Places API:

http://code.google.com/apis/maps/documentation/places/

或地点库(Google Maps JS API 的一部分):

http://code.google.com/apis/maps/documentation/javascript/places.html

您将在 JS 中解析响应,然后根据需要设置信息窗口的内容。请注意,从企业列表(至少在 Google 的域中)抓取内容来填充您的信息窗口违反了服务条款。

这是一个基本的例子:

http://code.google.com/apis/maps/documentation/javascript/examples/place-details.html

关于javascript - Google map - 让信息窗口显示?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8992890/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com