-
-
Notifications
You must be signed in to change notification settings - Fork 5
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] Provide a way to handle feature tap and drag events #151
Comments
Thanks for this feature request @gabbopalma. This is indeed a missing feature. The current design guidelines are:
There are two different options to handle the dragging: Option 1: as much dart as possibleKeeping the dragging logic inside dart and listen to additional events like Option 2: logic in kotlin and pass the results to dartI think this option is somewhat more work. The feature dragging is handled by the Annotation plugin, isn't it? We don't use it Speaking of the public API, the user works with, the flutter-maplibre-gl way using a I'd recommend to start like this: Step 1
Step 2
There are potential enhancements like move the map camera when the dragged marker is near an edge or only allow drag on long press. This could be part of Step 3. (: |
Feature Description
Currently there is no good way to detect if an element has been dragged by the user, almost with
Layer
features.I have not tried with the
StyleLayer
features, but previously onflutter-maplibre-gl
with thedraggable
layer option set to true, dragging was possible.Previously on
flutter-maplibre-gl
there was a way to handle drag events with:controller.onFeatureDrag
. In my opinion, this was a complex way to handle them, but if this can be the only way we can reproduce, it will be fine.Sample Use Case
Existing Alternatives or Workarounds
Currently there is no way to handle drag events, but with the
MapEventUserInput
event you can see which QueriedLayer was tapped. Also, it would be nice if you could give this method arange
nullable to query a feature in the range (in meters) of the pickup point.Additional Context
maplibre-native
flutter-maplibre-gl
plugin-annotation
The text was updated successfully, but these errors were encountered: