1

So I am having an issue where a user trying to click on a marker created by RichMarker will fire off the event of clicking on the marker BUT also right after fire off an event of clicking on the map.

I fixed the issue for desktop user thanks to this answer here:

RichMarker for Google Maps v3 - Click falls through marker

But adding the e.stopPropagation(); to the click event in RichMarker is not working on iOS devices. I am still running into the problem of a user clicking through the RichMarker and firing off a click event on the map.

Anyone have any suggestions or know why this would only happen on mobile? The marker click event is being triggered but the stopPropogation is not preventing the map click event from firing right after.

Thanks!

Community
  • 1
  • 1
Robert Garcia
  • 416
  • 3
  • 16

1 Answers1

1

You have to handle event touchend:

  1. Add touch event handler to RichMarker plugin: copy-paste code with click event handler and apply it to touchend event (at richmarker.js).
  2. Edit your marker.addListener('click') to handle click or touchend event depending on is_touch_device()

Also check here: How to stop propagation on google maps.

Community
  • 1
  • 1
psylosss
  • 3,469
  • 3
  • 16
  • 26