简体   繁体   English

如何使Google Map与网站内容互动

[英]How to make a Google Map interactive with website content

I have a Google Map that I created in the Google Map Maker with custom markers on it. 我有一个在Google Map Maker中创建的带有自定义标记的Google Map。 This map is embedded in my website. 该地图已嵌入我的网站中。

What I'd like to do is set it up in such a way that when a user clicks one of the "pins" on the Google Map, a div becomes visible on the website that provides more detail on that pin. 我要进行的设置方式是,当用户单击Google Map上的“图钉”之一时,在网站上就会显示一个div,其中提供了有关该图钉的更多详细信息。 When a user clicks another pin, the previous div goes invisible and the relevant div becomes visible with more detail on that pin etc. I know how to hide and show divs, its just the interaction with the Google Map that I don't fully understand. 当用户单击另一个图钉时,上一个div变为不可见,并且相关的div变得可见,并且具有该图钉的更多详细信息。我知道如何隐藏和显示div,它只是与我不完全了解的Google Map交互。

I understand this is most likely a job for JavaScript, but I'd love someone to point me in the right direction. 我知道这很可能是JavaScript的工作,但我希望有人指出正确的方向。

Here's the site in question http://oliwebconz.ipage.com/destinationwaikanae/stay.html 这是有问题的网站http://oliwebconz.ipage.com/destinationwaikanae/stay.html

Many thanks in advance! 提前谢谢了!
Ollie 奥利

Take a look at this documentation page from Google. 在Google上查看此文档页面 It shows you how to execute a function when you click on a marker on the map. 它显示了当您单击地图上的标记时如何执行功能。 In the pages around that page you can find more examples of adding listeners to ready events, map click event, zoom events etc. 在该页面周围的页面中,您可以找到将侦听器添加到就绪事件,地图单击事件,缩放事件等的更多示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM