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

后端 未结 2 1151
走了就别回头了
走了就别回头了 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);
        }
    

提交回复
热议问题