Skip to content

Gestures starting on clickable composables cannot trigger drag on the map #760

@cdelabou

Description

@cdelabou

We’re using Google Maps with Compose to overlay several interactive elements.

Gestures events that start on a clickable compose element never reach the MapView (since it isn’t a composable ancestor), so the map won’t move unless the gesture begins directly on it.

It would be useful if Google Maps could act as a “parent” to these composables, handling unconsumed gestures from other composables—eg. drag gestures started from a child that only listens for clicks.

While we can’t set composable children on the view, we can redirect gesture events from a composable to the view if we would have access to it.

Could there be options for clients to handle this? For example:

  • A second @Composable parameter in GoogleMap() with an internal event receiver for wiring gestures.

  • Exposing the MapView (via CompositionLocalProvider or a callback).

  • Allowing the view to be searchable in the hierarchy (id, name, or tag) for disambiguation when multiple maps exist.

Currently, we have some working POC of this which relies on MapApplier holding the mapView, which feels risky.

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage meI really want to be triaged.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions