-
Notifications
You must be signed in to change notification settings - Fork 41
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;
}