ljrod95
ljrod95

Reputation: 55

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

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. But does not do anything in the iOS emulator or running in the device. When running on the simulator or device I get no error or see any message associated with the event. Reading up on this issue I did set data-tap-disable="true" on the div we're the map resides. Can't seem to find any other solution. What can I do to fix this?

Upvotes: 0

Views: 1423

Answers (2)

Aymen Boumaiza
Aymen Boumaiza

Reputation: 1419

// 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);
    }

Upvotes: 0

Dylan Aspden
Dylan Aspden

Reputation: 1692

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.

Upvotes: 2

Related Questions