capacitor-community / capacitor-community/google-maps

feat(myLocation): call MyLocationButton programmatically

Open
#136 4 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
161
Forks
65
PR merge metrics
No merged PRs in 30d

Description

**!! This feature request is related to the fork of @tafelnl !!**

**Is your feature request related to a problem? Please describe.**
Currently it is possible to display the native myLocationButton in the map, which allows navigation to the current location.
At the moment, programmatic navigation is not possible, which excludes two important use-cases:

1. Navigation to the current location, due to life-cycle events or a specific business logic.
2. Creating custom UI to trigger navigation to the current location (e.g. using `ion-fab-button` instead of MyLocationButton). This also allows the button to be placed anywhere (instead of just bottom right)

A workaround would be the method `moveCamera()` by querying the current location beforehand.
However, this loses the advantage of the event listener `didTapMyLocationButton()`.

**Describe the solution you'd like**
Extend CapacitorGoogleMaps with the method `tapMyLocationButton()`, which triggers the click on myLocationButton.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.