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

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

问题描述

我们遇到与GoogleMaps相关的问题。这个问题主要与触摸屏有关。我们试图解决这个问题,但迄今为止没有成功。



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



更新

该错误



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



已于2016年12月在Google Maps JavaScript API版本3.27中解决。

mousedown , mouseup ,解决方案 dragstart dragend 事件可以很好地代替 touchstart touchmove touchend

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

我很确定 gesture 个事件将不会被支持,因为这些用于捏放大功能。



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

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.

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

UPDATE

This issue was handled in the bug

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

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

解决方案

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){...});

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天全站免登陆