Google Maps Javascript API不响应iOS 10中的触摸事件 [英] Google Maps Javascript API Doesn't Respond to Touch Events in iOS 10

查看:132
本文介绍了Google Maps Javascript API不响应iOS 10中的触摸事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我运行一个网站,其中内置了许多自定义的Google地图(在搜索或在某个位置产生路线指示后,在地图上显示各个位置)。我为此使用Google Maps JavaScript API。我的用户已经开始报告说,在iOS 10上,这些地图不再对触摸事件做出响应 - 它们无法捏缩缩放,也不能在地图上点击引脚来打开位置信息气球。



我一直在寻找所有有此问题的人都无济于事。我在这里发现了一个StackOverflow问题( http://webcache.googleusercontent.com/search?q=cache:DaiSdOgD0U4J: stackoverflow.com/questions/39401974/google-maps-javascript-doesnt-pan-or-zoom-in-ios-10+&cd=3&hl=en&ct=clnk&gl=us ) ,但是它被低估了,然后被删除了。 (为什么?)今天的新搜索仍然显示该页面,但它导致404,使搜索更令人沮丧。

有其他人经历过吗?这是Google Maps API中的错误吗?我当然无法在他们的开发者网站上找到任何有关此事的信息我是否可能做出一些非常错误的事情来导致这种情况?该代码已运行多年,并且在几个月内尚未修改,因此我们的结局没有任何变化。




  • 我们使用我们已经尝试从
    当前版本(3.25)切换到当前的实验版本
    (3.26),并且没有任何更改功能。

  • 用户报告这种情况至少发生在iOS 10上的Safari和Chrome浏览器中



只是希望有人可以就此提供任何见解。

解决方案

好的,我是如何解决这个问题的。
提醒我通过Ionic框架使用AngularJS。
我在index.html中以这种方式调用地图:

 < script src =https:/ /maps.googleapis.com/maps/api/js?libraries=places&key=PUT_YOUR_GOOGLE_API_KEY_HERE&signed_in=true\"></script> 

谷歌地图的signed_in功能类似于在地图上添加一层不会让地图的图层获取屏幕触摸位置的X,Y.



我刚被false取代以禁用signed_in功能,它的功能就像一个魅力



< pre> >< /脚本>


I run a website with a number of custom Google Maps built in (showing various locations on a map after a search or generating directions to/from a location). I use Google Maps Javascript API for this. My users have started reporting that on iOS 10, these maps no longer respond to touch events -- they cannot pinch-to-zoom nor can they click on the "pins" on the map to open the location info balloons.

I've been searching all over for others who have had this issue to no avail. I found one StackOverflow question here (http://webcache.googleusercontent.com/search?q=cache:DaiSdOgD0U4J:stackoverflow.com/questions/39401974/google-maps-javascript-doesnt-pan-or-zoom-in-ios-10+&cd=3&hl=en&ct=clnk&gl=us), but it was downvoted, then deleted. (Why?) A fresh search today still shows that page, but it leads to a 404, making a search even more frustrating.

Has anyone else experienced this? Is this a bug within the Google Maps API? I certainly can't find anything about that on their Developer website. Am I possibly doing something very wrong to lead to this? The code has worked for years and hasn't been modified in a few months now, so nothing changed on our end.

  • We do use an API key in our requests
  • I've tried switching from the current release version (3.25) to the current experimental version (3.26) with no changes in functionality.
  • Users report this happens in at least both Safari and Chrome on iOS 10

Just hoping someone can provide any insight at all on the issue.

解决方案

Ok here is how I did to fix this issue. As a reminder i'm using AngularJS via the Ionic framework. I was calling the map this way in my index.html :

<script src="https://maps.googleapis.com/maps/api/js?libraries=places&key=PUT_YOUR_GOOGLE_API_KEY_HERE&signed_in=true"></script>

It seams like signed_in feature of google map is adding a layer on the map that is not letting the map getting the X,Y of your screen touch position.

I just replaced by false to disable the signed_in feature and its working like a charm

<script src="https://maps.googleapis.com/maps/api/js?libraries=places&key=PUT_YOUR_GOOGLE_API_KEY_HERE&signed_in=false"></script>

这篇关于Google Maps Javascript API不响应iOS 10中的触摸事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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