Google Maps API v3 click event not working in Ionic emulator or device

后端 未结 2 1150
走了就别回头了
走了就别回头了 2021-01-26 01:41

I have a google maps implementation with various dropped pins. When clicked they open a information Window with a simple string. This all works well and dandy in the Ionic serve

相关标签:
2条回答
  • 2021-01-26 02:38

    // Fix for Google AutoComplete Places Javascript API on iOS WORK and tested on iphone5/6/7

    if (navigator.userAgent.match(/(iPad|iPhone|iPod)/g)) {
            setTimeout(function () {
                let container = document.getElementsByClassName('pac-container')[0];
                // Fix for Google AutoComplete Places Javascript API on iOS
                if (container) {
                    container.addEventListener('touchend', function (e) {
                        e.stopImmediatePropagation();
                    });
                }
            }, 500);
        }
    
    0 讨论(0)
  • 2021-01-26 02:39

    I had the same issue as you, try putting data-tap-disabled="true" on the div that contains the map. I had to take it even a step further and write something to apply data-tap-disabled="true" only when the info-window is showing.

    Note I used data-tap-disabled while you're saying you tried data-tap-disable.

    0 讨论(0)
提交回复
热议问题