capacitor-community / capacitor-community/google-maps

Define touch delegation areas

Open
#235 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
161
Forks
65
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
I see that touch delegation is marked as WIP. I also feel that the plugin has issues with figuring out when to delegate touch (it often takes two consecutive taps to get one tap delegated to the map). I also see that empty divs that overlap the map will prevent touch delegation.

So here's my feature request:

Add an API that allows to delegate taps programmatically. This would allow to set listeners to HTML elements that can be patched through to the map without the need for any advanced magic to figure out if the touch should be delegated or not. This would also allow for more complex overlays.

Example:

**Does this feature exist in the Google Maps SDK for android and iOS? Please link the documentation for this feature.**

I don't know

**Describe the solution you'd like**

Be able to define HTMLElements as "delegate touch events to Google Maps layer".

**Additional context**

Example

Problem: Area with pink border is a container for the controls that won't delegate touch to the Google Map _at all_, not even in the empty areas. All other parts of the map don't react to taps immediately if the user clicked on one of the WebView components before.

Solutions: Overlay areas that should be delegated to the Google Map with invisible divs (in this example the red, green and blue areas). define those divs as "alway delegate touch events to Google Map".

![example](https://github.com/capacitor-community/google-maps/assets/11460463/d822e324-9670-48c9-af6a-a05971fe3b1b)

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.