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

How can I get the position of the clicked polylineAnnotation #699

Open
lantah-1 opened this issue Sep 20, 2024 · 6 comments
Open

How can I get the position of the clicked polylineAnnotation #699

lantah-1 opened this issue Sep 20, 2024 · 6 comments

Comments

@lantah-1
Copy link
Contributor

lantah-1 commented Sep 20, 2024

final manager = await mapboxMap.annotations.createPolylineAnnotationManager(); manager.addOnPolylineAnnotationClickListener(_LineAnnotationClickListener((an) { // How can i get the position of clicked event }));

@evil159 can you help me ? thanks very much.

@evil159
Copy link
Contributor

evil159 commented Sep 20, 2024

@lantah-1 I don't think you can get that from this listener

@lantah-1
Copy link
Contributor Author

@lantah-1 I don't think you can get that from this listener

My app needs to know which point on the route was clicked. How can I get it?

@evil159
Copy link
Contributor

evil159 commented Sep 20, 2024

I think currently the only way to do that is to add your own click listener that will give you screen coordinates and then pass them to the 'queryRenderedFeatures' method.

@evil159
Copy link
Contributor

evil159 commented Sep 20, 2024

We plan to pass touch coordinates along with the annotation though.

@lantah-1
Copy link
Contributor Author

I think currently the only way to do that is to add your own click listener that will give you screen coordinates and then pass them to the 'queryRenderedFeatures' method.

CleanShot 2024-09-20 at 18 13 00@2x
This callback returns true, which causes the map's onMapClick method to not be called back.

@lantah-1
Copy link
Contributor Author

We plan to pass touch coordinates along with the annotation though.

Looking forward to it !!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants