We have a site that uses Google Maps API v3 to display a bunch of markers on the map. The markers are clickable, and open a standard Google Maps info popup.
This works great on all desktop browsers. But for some reason, I can't make it work on any mobile device that I've tested (a variety of Android and iOS devices). The markers simply don't respond to clicks.
I've narrowed it down to our custom markers. If I remove the code that loads our custom marker images using new google.maps.MarkerImage()
, then it works fine.
var marker = new google.maps.Marker(
var markerOptions = {
icon : new google.maps.MarkerImage(
mURL, new google.maps.Size(mWidth,mHeight),
new google.maps.Point(0,0),new google.maps.Point(anchorX,anchorY)
),
flat: true,
position: point,
visible: true,
title: title,
zIndex: zIndex,
map: map,
}
);
google.maps.event.addListener(marker,'click',function() { ...... });
The above code works fine on all desktop browsers, but fails in all mobile browsers. However, if I remove the custom graphic (ie the 'icon' property), it works fine.
Any ideas? I'm pulling my hair out!