简体   繁体   中英

Google Maps not interactive in Chrome mobile

I'm using Google Maps in a HTML5, jQuery Mobile based mobile site. The problem is that in Chrome the map isn't interactive, ie not behaving as expected: Pinching, paning or any gestures simply does not work. The map more or less behaves as a picture, if I pinch it the browser eventually zooms in the entire site. Weirdly, if I manage to hit the top left +/- buttons on the map, it zooms as expected - albeit a bit slow / choppy.

Worth mentioning is that I'm using several map markers as well as a function that sets the zoom of the map to the markers bound. This is by the way "rendered" correctly in all tested browsers.

I've tested the site in several desktop browsers (including Chrome), all working correctly. As for mobile browsers I've tested Android Browser, Opera Mobile, Safari and finally Chrome Mobile. The map error occurs in both Android and IOS versions of Chrome.

Seeing that it works in the majority of mobile browsers and that Chrome is the newcomer of the bunch, I'm wondering if anyone else has seen this behavior? Hoping that may be the case I'm not attaching any code for now. However, if someone think this might be caused by an error in the code, I'll gladly edit it in.

So gestureHandling: 'greedy' !!!

var map = new google.maps.Map(document.getElementById('map'), {
      zoom: 14,
      styles: styleArray,
      center: myLatLng,
      gestureHandling: 'greedy'
    });  

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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