Does Google Maps API V3 support touch event?

后端 未结 2 1983
清歌不尽
清歌不尽 2020-12-11 18:54

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 fou

2条回答
  •  一整个雨季
    2020-12-11 19:01

    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...

提交回复
热议问题