Infowindow close event of google map doesnot work in mobile?


#1

I am facing the issue while closing the infowindow. Its not getting close? Any solution?


#2

to handle this touch events with google maps api v3 you need to create a maps OverlayView:

// create map overlay to handle touch events
overlay = new google.maps.OverlayView();
overlay.draw = function () {};
overlay.setMap(myMap);

In my app it works!

Greetz.


#3

@bengtler Thanks! can you help with a codepen?


#4

It is a little bit complex in my app.
But it is really simple.

After you make something like this:

var map = new google.maps.Map(element, mapOptions);

You put a overlay on the map

// create map overlay to handle touch events
overlay = new google.maps.OverlayView();
overlay.draw = function () {};
overlay.setMap(map);

And nothing more.