question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Event Listeners on Android not firing?

See original GitHub issue

Describe the bug On android, it seems any event listener (outside of map ready) is not firing. Same app on IOS is working fine.

To Reproduce Have created various event listeners

CapacitorGoogleMaps.addListener("didTapAt", () => {
        console.log("map tapped!");
      });

CapacitorGoogleMaps.addListener("didChange", () => {
        console.log("map changed!");
      });

Expected behavior didChange, didTap, didTapAt to trigger event listener. Is this working for others?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
svrakatacommented, Jul 21, 2021

For everyone wondering. For events to fire call await CapacitorGoogleMaps.setOnMarkerClickListener(); await CapacitorGoogleMaps.setOnMapClickListener(); in the onMapReady handler.

1reaction
tafelnlcommented, Jun 28, 2021

@J-Gonzalez That is a pretty valid approach. It could be refactored of course. But it does its job well.

I am not part of the maintenance team, but I am working hard to get a v2 release out there: #85

Read more comments on GitHub >

github_iconTop Results From Across the Web

Event listeners not working? 3 key areas to troubleshoot
If your event listener not working is dependent on some logic, whether it's about which element it'll listen on or if it's registered...
Read more >
Android custom view event listeners not working properly ...
I'm creating a custom compound view in android which contains two TextViews within a relative layout. There are two ...
Read more >
Basic Event Listeners | CodePath Android Cliffnotes
Troubleshooting: Item Click Not Firing If the item is more complex and does not seem to be properly responding to clicks after setting...
Read more >
Input events overview - Android Developers
An event listener is an interface in the View class that contains a single callback method. These methods will be called by the...
Read more >
InAppBrowser events not firing on Android (Cordova 3.1.0)
I ended up reverting my android project code via version control and backed out my changes. I then put back in the same...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found