I’m using this very basic code to make InfoWindow a ‘singleton’ and open it where needed. (In a UIWebView on iOS5)
google.maps.event.addListener(marker, 'click', function() {
infowindow.setContent(content);
infowindow.open(map,marker);
reportClickedMarker();
});
The problem is that the infoWindows seems to open very slowly. When I click the first marker it opens after a delay of 0-1 second. The second marker, which is fairly close to the first, opens after +1 second, and a third marker (sometimes) doesn’t open at all. I tried it without the call to
reportClickedMarker();
but that doesn’t change anything. Only when I doubleClick on the markers it opens immediately.
a) Does anyone what might be wrong, or is that even normal behavior (the delay?)
b) Can i “fake” a doubleclick on a marker?
Thanks in advance
It appears you are hitting the infamous delay for click events on mobile devices. The delay is built in as the platform needs to determine if the touch is the start of a gesture. Instead of click, try using the touchend event.
See http://cubiq.org/remove-onclick-delay-on-webkit-for-iphone