Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Detect if a layer has been clicked #71

Open
josxha opened this issue Oct 6, 2024 · 1 comment · May be fixed by #78
Open

[FEATURE] Detect if a layer has been clicked #71

josxha opened this issue Oct 6, 2024 · 1 comment · May be fixed by #78
Labels
feature New feature or request

Comments

@josxha
Copy link
Owner

josxha commented Oct 6, 2024

Feature Description

There is currently no good way to detect if a marker, circle or item of an other layer has been received gesture input by the user.

Describe alternatives you've considered

We can already detect gesture inputs to the map in general and listen to the via the map events callback. It is currently not possible to check for the clicked layers with this.

Additional context

@josxha josxha added the feature New feature or request label Oct 6, 2024
@josxha josxha added this to the v0.1.0 milestone Oct 6, 2024
@josxha josxha removed this from the v0.1.0 milestone Oct 9, 2024
@josxha
Copy link
Owner Author

josxha commented Oct 9, 2024

MapLibre GL JS and MapLibre Android both have a queryRenderedFeatures method but both return different results.
ML Android only returns the GeoJSON Features while ML GL JS additioanlly returns the layer id and layer source id.

The MapLibre Android Annotations Plugin detects if a annotation layer has been clicked by checking every layer on it's own. If the returns Feature list is empty, the Annotation Layer has not been clicked, if it contains 1 item, it has been clicked.

https://github.com/maplibre/maplibre-plugins-android/blob/main/plugin-annotation/src/main/java/org/maplibre/android/plugins/annotation/AnnotationManager.java#L447-L454

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

1 participant