为什么iPad上的Safari不会在嵌入式Google地图页面上显示我的标记? [英] Why does Safari on the iPad not display my marker on an embedded Google Maps page?

查看:131
本文介绍了为什么iPad上的Safari不会在嵌入式Google地图页面上显示我的标记?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须将Google地图嵌入到客户的网页中。

我希望地图显示一个标记,显示客户业务的确切位置以及它们的摘要详细信息(地址,网页,电话号码等)。

我使用的代码是由Google Maps网站提供的(不是第三方服务),我没有修改它。 >
这在我测试过的每个桌面浏览器都很好,并且标记显示正确。

然而,当我在iPad上查看页面时,标记从地图中删除。而是在地图下方以A. Client's Name的形式存在一个链接(我不知道A.代表什么)。点击(点击)时,此链接不会执行任何操作。如果我按住它并选择在新选项卡中打开,它会按照您的预期在新选项卡中打开客户的Google地方信息页。



旁边这个链接是两个按钮(一个电话,一个其他的东西,可能是'获取路线'),点击时会显示Safari无法打开页面,因为地址无效。

这是一个jsfiddle(使用随机业务),它说明了我的问题: http://jsfiddle.net / H2whg /



是否可以在移动Safari中对此行为做任何事情(或者让按钮做一些合理的事情或者完全删除它们) ?



预先感谢。

显示您的标记,但它位于地图显示的区域的南部。



您的来源相当长:



http://maps.google.de/maps?f=q&源= s_q&安培; HL = DE&安培;地址解析=安培; q =哈罗兹,+普顿+路+伦敦,+格罗%C3%9Fbritannien&安培;水溶液= 0&安培; OQ =哈罗兹&安培; SLL = 51.500808,-0.143003&安培; SSPN = 0.006532 ,0.016512和放大器; G =白金汉宫+宫,+伦敦+美国+英国和放大器;即= UTF8&放大器; HQ = Harrods百货公司,+布朗普顿+路+伦敦+格罗%C3%9Fbritannien和放大器; hnear =安培;半径= 15000& T公司= m& cid = 5481296058834203814& ll = 51.515366,-0.157413& spn = 0.037389,0.072956& z = 13& iwloc =&输出=嵌入

< iPad版本中存在一些冲突。特别是 ll 修正了地图中心—而你想要那里的标记。由于您有 z 来修正缩放,所以您不需要 spn ,它定义了一个跨度以适应地图



摆脱这两者,确实可以在地图上显示标记。



http:// maps。 google.de/maps?f=q&source=s_q&hl=de&geocode=&q=Harrods,+Brompton+Road,+London,+Gro%C3%9Fbritannien&aq=0&oq=harrods&sll = 51.500808,-0.143003和放大器; SSPN = 0.006532,0.016512和放大器; G =白金汉宫+宫,+伦敦+美国+英国和放大器;即= UTF8&放大器; HQ = Harrods百货公司,+布朗普顿+路+伦敦+格罗%C3%9Fbri tannien& hnear =& radius = 15000& t = m& cid = 5481296058834203814& z = 13& iwloc = A& output = embed iPad实现不使用infoWindow。相反,您会在地图中获得一系列标记,从A开始,并在其下方显示相应的列表。


I have to embed Google Maps on a web page for a client.
I would like the map to show a marker which displays the exact location of the client's business, as well as a summary of their details (address, web page, phone number etc).
The code I am using to do this was provided by the Google Maps website (not a third party service) and I have not modified it.
This works great in every desktop browser I have tested and the marker is displayed correctly.

However, when I view the page on an iPad, the marker is removed from the map.
Instead there is a link below the map in the form of " A. Client's Name" (where I have no idea what the A. stands for). When clicked (tapped) this link does nothing. If I hold my finger on it and select "Open in new tab", it opens my client's Google Places page in a new tab, as you would expect.

Next to this link are two buttons (one of a phone, one of something else, possibly 'get directions'), which when clicked display the message "Safari cannot open the page because the address is invalid"

Here is a jsfiddle (using a random business) which illustrates my problem: http://jsfiddle.net/H2whg/

Is it possible to do anything about this behaviour in mobile safari (either have the buttons do something sensible or remove them entirely)?

Thanks in advance.

解决方案

It does display your marker, but it's south of the area displayed by the map.

Your source is quite long:

http://maps.google.de/maps?f=q&source=s_q&hl=de&geocode=&q=Harrods,+Brompton+Road,+London,+Gro%C3%9Fbritannien&aq=0&oq=harrods&sll=51.500808,-0.143003&sspn=0.006532,0.016512&g=Buckingham+Palace,+London,+United+Kingdom&ie=UTF8&hq=Harrods,+Brompton+Road,+London,+Gro%C3%9Fbritannien&hnear=&radius=15000&t=m&cid=5481296058834203814&ll=51.515366,-0.157413&spn=0.037389,0.072956&z=13&iwloc=A&output=embed

and there are some conflicts in the iPad version. In particular, ll fixes the map centre — whereas you want your marker there. As you have z to fix the zoom, you don't need spn which defines a span to fit into the map.

Getting rid of both of those does allow the marker to be shown on the map.

http://maps.google.de/maps?f=q&source=s_q&hl=de&geocode=&q=Harrods,+Brompton+Road,+London,+Gro%C3%9Fbritannien&aq=0&oq=harrods&sll=51.500808,-0.143003&sspn=0.006532,0.016512&g=Buckingham+Palace,+London,+United+Kingdom&ie=UTF8&hq=Harrods,+Brompton+Road,+London,+Gro%C3%9Fbritannien&hnear=&radius=15000&t=m&cid=5481296058834203814&z=13&iwloc=A&output=embed

Note that the iPad implementation doesn't use an infoWindow. Instead you get a series of markers in the map, starting with A and a corresponding list below it.

这篇关于为什么iPad上的Safari不会在嵌入式Google地图页面上显示我的标记?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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