capacitor-community / capacitor-community/google-maps
feat(myLocation): call MyLocationButton programmatically
- 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
Assessment
This issue has not been assessed yet.