-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Event Listeners on Android not firing? #86
Comments
Event listeners have different names on Android. This is a bit unfortunate but it will be normalized in v2! For now the following events are sent out on Android:
|
Interesting. I seem to not be getting the didTapAt event to fire at all. Does Android have some logic on where I should be adding the listeners? Should it be inside onMapReady listener (in JS code) or should it not matter? As a side note, I was able to get 'didChange' to fire by putting cameraIdle inside of onMapReady, but don't think this is the correct approach at all (my Java and native code writing is VERY rusty) @Override
public void onMapReady(GoogleMap googleMap) {
this.googleMap = googleMap;
notifyListeners("onMapReady", null);
this.googleMap.setOnCameraIdleListener(new GoogleMap.OnCameraIdleListener() {
@Override
public void onCameraIdle() {
notifyListeners("didChange", null);
}
});
} |
@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 |
For everyone wondering. For events to fire call |
We've just released a (pretty stable) beta for version 2 of this plugin under the name It features a more complete and consistent API. Also the map can finally be rendered behind the webview in this new version. Extensive documentation for v2 can be found here: https://capacitor-community.github.io/google-maps/ Since version 1 lacked a lot of (basic) features, did not have good coding practices, had a poor API and it is not recommended to use it anymore, we've dropped support for it. Therefore I will close this issue. We believe version 2 offers a better Developer Experience and is a much better fit for anyones use case. |
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
Expected behavior
didChange, didTap, didTapAt to trigger event listener. Is this working for others?
The text was updated successfully, but these errors were encountered: