The click event doesn't fire on iOS with the following JavaScript. It works fine on Windows. Why is this happening? Is there a workaround?
const pin = new google.maps.marker.PinElement({
scale: 1.0,
glyphColor: "green"
});
var testMarker = new google.maps.marker.AdvancedMarkerElement({
content: pin.element,
gmpClickable: true,
gmpDraggable: true
});
testMarker.position = new google.maps.LatLng(
34.718420, 135.556109
);
testMarker.map = mapObj;
testMarker.addListener(
'dragend',
function (event) {
alert('dragged');
}
);
testMarker.addListener(
'click',
function (event) {
alert('clicked');
}
);
On Windows + Chrome, the "clicked" alert is displayed correctly, but on iOS + Chrome (or Safari), nothing happens. Regarding "dragend", it works as expected in both cases. Using "gmp-click" instead of the "click" event produces the same results. Also, if you don't add the "dragend" event, the click event works correctly.