Google Maps API V3 是否支持触摸事件? [英] Does Google Maps API V3 support touch event?

查看:19
本文介绍了Google Maps API V3 是否支持触摸事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们遇到了与 Google 地图相关的问题.该问题主要与触摸屏有关.我们试图解决这个问题,但到目前为止没有成功.

We are experiencing an issue related to GoogleMaps. The issue is mainly related to touch screens. We were trying to resolve the issue, but so far no success.

我们发现 在本文中 Google Maps API V3 不支持触​​摸事件?这是真的还是假的?

We found in this article that the Google Maps API V3 does not supports touch event? Is this is true or false?

更新

此问题已在错误中处理

https://issuetracker.google.com/issues/35824421

并于 2016 年 12 月在 Google Maps JavaScript API 3.27 版中解决.

and was solved in version 3.27 of Google Maps JavaScript API in December 2016.

推荐答案

以我的经验,mousedownmouseupdragstartdragend 事件可以很好地代替 touchstarttouchmovetouchend.

In my experience, the mousedown, mouseup, dragstart, dragend events work fine in place of touchstart, touchmove, touchend.

google.maps.event.addListener(myMap, "mousedown", function(event){...});

我很确定将不支持 gesture 事件,因为它们用于双指缩放功能.

I'm pretty sure that gesture events are not going to be supported, since those are used for pinch-zoom functionality.

如果您需要手势,则必须通过跟踪鼠标按下事件、将它们存储在数组中、然后跟踪位置以确定角度、距离等来构建自己的识别器...

If you need gestures, you'd have to build your own recognizer by tracking mousedown events, storing them in an array, then tracking positions to determine angles, distances etc...

这篇关于Google Maps API V3 是否支持触摸事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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