网站中的Google地图 [英] Google maps in website

查看:237
本文介绍了网站中的Google地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个asp.net网站,页面上有Google地图.输入地址时,我使用了从Google地图链接获取的iframe代码.这是代码的jsfiddle:

http://jsfiddle.net/4EaUw/ [ ^ ]

一切正常,但是我这里有两个问题,

这可能是简单的问题,但我无法弄清楚.
第一个是当我们单击信息框上的路线链接时,它将在同一页面中打开地图.我想在其他窗口中打开地图.我该如何实现?

其次,有什么方法可以让我们在加载页面时仅显示地图标记,而不显示信息框.当我们单击地图标记时,我想打开信息框.

另外,我们可以通过此iframe代码实现此目标,还是需要使用Google Maps API?

提前谢谢.

蝎子

使您能够单击链接[/编辑]

Hi,

I have a asp.net web site which has a Google map in the page. I used the iframe code which we get from Google map link when we give an address. Here is the jsfiddle of the code:

http://jsfiddle.net/4EaUw/[^]

It is working fine but, I have two issues here,

This might be simple issues but I am not able to figure out.
First one is when we click on the directions link on the info box, it opens the map in the same page. I want to open the map in different window. How can I achieve that?

Secondly, is there any way we can just show the map marker but not the info box when page is loaded. I want to open the info box when we click on the map marker.

Also, can we achieve this by this iframe code or do we need to use google maps api?

Thanks in advance.

Scorpion

Made able you can click on the link[/Edit]

推荐答案

我认为您需要的一切都在这里:
I think that everything you need is here:google maps api reference




我找到了第二个问题的解决方案.

默认情况下,我们可以通过在iFrame源网址的末尾添加& iwloc = near"来删除信息框.

检查下面的链接以获取更多详细信息:
http://commconn.co.uk/2012/02 /10/quick-tricks-with-google-maps-and-iframes/ [
Hi,

I found the solution for the second question.

We can remove the info box by default by adding "&iwloc=near" at the end of the iFrame source Url.

Check the below link for more details:
http://commconn.co.uk/2012/02/10/quick-tricks-with-google-maps-and-iframes/[^]

Thanks,

Scorpion


这篇关于网站中的Google地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆