You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[google_maps_flutter] Markers do not obey consumeTapEvents configuration #39868
If you set Marker.consumeTapEvents I would expect the onTap handler not to be called. Currently the event is passed to onTap.
When setting consumeTapEvents to false for Polygons, Polylines, Circles etc. the click handler is not attached to the element, for markers there is no option to disable the click listener in the Google Maps implementation so the result needs to be filtered out in the marker click listener.
I believe this is working correctly, but it's just an odd api decision and confusing documentation. There's two tap handlers: the default handler which centers the map on the marker, and there's the user's custom onTap handler. To disable the default handler, set consumeTapEvents to true. To disable the user's handler, set onTap to null.
This works for me on iOS to disable the centering on the marker with a custom tap handler, haven't tested Android.
Activity
pedromassangocode commentedon Apr 28, 2021
Still reproducible on current version of the maps plugin.
code sample
3d82bdc Revert "Add testing hints (flutter#39868)" (flutter-team-arch…
3d82bdc Revert "Add testing hints (flutter#39868)" (flutter-team-arch…
4aad948 Reland: Add testing hints (flutter#39868) (flutter-team-archi…
4aad948 Reland: Add testing hints (flutter#39868) (flutter-team-archi…
nzkn commentedon Aug 1, 2023
Not fixed in the latest version
nzkn commentedon Aug 1, 2023
jaween commentedon Sep 21, 2023
I believe this is working correctly, but it's just an odd api decision and confusing documentation. There's two tap handlers: the default handler which centers the map on the marker, and there's the user's custom
onTaphandler. To disable the default handler, setconsumeTapEventstotrue. To disable the user's handler, setonTaptonull.This works for me on iOS to disable the centering on the marker with a custom tap handler, haven't tested Android.