ionic-team / ionic-team/capacitor-google-maps

Feature Request: Expose a method to Convert Tap Coordinates to LatLng

Open
#85 0 comments 0 reactions 0 assignees View on GitHub
triage
Dominant language
TypeScript
Stars
32
Forks
47
PR merge metrics
No merged PRs in 30d

Description

Feature Request: Expose a method to Convert Tap Coordinates to LatLng
Request type: Feature Addition

❓ What is the feature?
Expose a method like:

`await map.fromLatLngToPoint({ x: number, y: number }): Promise<{ lat: number; lng: number }>;`

This would convert screen pixel coordinates (e.g., from a touch or click) to latitude and longitude using the native map projection.

it would be similar to the official google maps JS api method:

```
const googleMap: google.maps.Map = ....
const projection = googleMap.getProjection();
const example = projection.fromLatLngToPoint({
lat: position.lat,
lng: position.lng
});
```

💡 Why is it needed?
Currently, developers using @capacitor/google-maps on mobile cannot translate screen touch coordinates (e.g. from a transparent overlay or gesture) into geographic coordinates.

On the web (Google Maps JS API), this is possible using OverlayView's projection methods. However, in native maps via this plugin, there is no way to do this through the public API — even though the native SDKs expose this functionality:

iOS GMSProjection.coordinate(for:)

Android Projection.fromScreenLocation()

Use cases:

Provide immediate feedback on touch (bypassing onMapClick delays caused by double-tap detection)

Detect which marker or region is under a user’s tap

Custom tap overlays that require coordinate conversion

✅ Suggested API

// Input
{
x: number; // screen x
y: number; // screen y
}

{
lat: number;
lng: number;
}

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.