简体   繁体   English

Google Maps触摸事件在移动设备上不起作用

[英]Google Maps touch events not working on mobile devices

I'm running into an issue where touch events do not work, but click events do. 我遇到了触摸事件不起作用而单击事件起作用的问题。

If you visit Google's Javascript Events page , you'll notice that click events work and so do drag events. 如果您访问Google的Javascript Events页面 ,您会注意到click事件起作用,而拖动事件也起作用。 Now, in Chrome, use the device tool to change to an iPad. 现在,在Chrome中,使用设备工具更改为iPad。 Without refreshing, try to drag and swipe around. 不刷新,请尝试拖动和滑动。 It won't work. 它不会工作。 Normal click events will still work. 正常的点击事件仍然有效。 Now refresh the page while in iPad device view. 现在,在iPad设备视图中刷新页面。 The touch events will work. 触摸事件将起作用。

Our issue is that we're always stuck with the touch events not working, even on touch devices. 我们的问题是,即使在触摸设备上,我们也始终无法解决触摸事件。

Actually, there are already two related Issues #6425 and #4599 reported in gmaps-api-issues. 实际上,gmaps-api-issues中已经报告了两个相关的问题#6425#4599

And, based from the threads, these issues are not fully resolved yet. 并且,从线程来看,这些问题尚未完全解决。 There are, however, given workarounds which you can also try and one is available in GitHub - googleMapsAPITouchWorkaround . 但是,有给定的解决方法,您也可以尝试,并且可以在GitHub中找到-googleMapsAPITouchWorkaround

For more of the workarounds, please go through the issues recorded in the tracker. 有关更多解决方法,请仔细阅读跟踪器中记录的问题。

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

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