Skip to content

feat(myLocation): call MyLocationButton programmatically #136

@DwieDima

Description

@DwieDima

!! 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions