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

Add drag events to Symbol #464

Open
pamtbaau opened this issue Jun 11, 2024 · 3 comments
Open

Add drag events to Symbol #464

pamtbaau opened this issue Jun 11, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@pamtbaau
Copy link

Feature Description

Symbols can be marked as draggable and can be dragged around in the Map.

However, there is no option to add a callback to catch the dragging. I would love to see events like for example dragStart and dragEnd.

Describe alternatives you've considered

I've tried to add Features instead of Symbols, because there is a MapLibreMapController.onFeatureDrag.add(), but unfortunately, Features appear not to be draggable in the Map and the drag callback is never being called.

Additional context

No response

@pamtbaau pamtbaau added the enhancement New feature or request label Jun 11, 2024
@elliotrtd
Copy link

@pamtbaau Just figured I'd let you know the solution I found for this (maybe you found something better but I've seen a few posts about this on both MapLibre and MapBox).

For me I wrapped my Map in a GestureDector widget, and then I used the onPanEnd function to detect when movement has stopped.

When the movement stops I query the ID of the symbol that I care about and get its co-ordninates.

@pamtbaau
Copy link
Author

pamtbaau commented Sep 3, 2024

@elliotrtd That's much appreciated.

As development of flutter-maplibre feels a bit sluggish I'm afraid it will not be a flourishing and stable library to base an application upon. I've given it a try because it's the only library I found that supports free "aerial" maps.

@elliotrtd
Copy link

@pamtbaau I have to admit I'm in much the same boat in terms of giving it a try. I do however appreciate that it is an "official" package which supports both web and mobile. With the paid competitor it was a third party package which whilst well done - was not perfect.

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

No branches or pull requests

2 participants