flutter_map icon indicating copy to clipboard operation
flutter_map copied to clipboard

[FEATURE] Ability to ignore long-presses and allow dragging

Open victor0726 opened this issue 3 years ago • 18 comments

hi, Generally, there is no problem in dragging the map, but after long-pressing the screen, dragging the map cannot move. Is there any attribute that needs to be set? Thank you.

victor0726 avatar May 13 '22 01:05 victor0726

Hi there, I've personally never experienced this issue before. Can you please provide a minimal reproducible example to help us debug the issue? Thanks :)

JaffaKetchup avatar May 13 '22 06:05 JaffaKetchup

Is this what you're experiencing: https://github.com/fleaflet/flutter_map/issues/1111#issuecomment-1002622973?

JaffaKetchup avatar May 13 '22 06:05 JaffaKetchup

Is this what you're experiencing: #1111 (comment)?

The sample program provided by flutter_map also has the same problem. thanks.

victor0726 avatar May 16 '22 00:05 victor0726

hi, Drag directly after long-pressing on the map, the map cannot be moved。

thank you.

victor0726 avatar May 16 '22 02:05 victor0726

Ah I see. This isn't a bug, but also not intended functionality. This is a very rare use case: can I ask what you need this for, if you don't mind?

JaffaKetchup avatar May 16 '22 06:05 JaffaKetchup

Ah I see. This isn't a bug, but also not intended functionality. This is a very rare use case: can I ask what you need this for, if you don't mind?

hi I know this is not a bug, but it is a bit inconvenient for users to use. I have tested other map apps and there is no such problem. I don't need the long-press function, so long-press-drag and click-drag must be treated as the same action.

Thanks for your reply

victor0726 avatar May 16 '22 07:05 victor0726

In this case, this will have to be converted to a feature request. Note that waiting times on feature requests are currently indefinite at this time - unless a PR can be supplied - as we (maintainers) are quite stretched at the moment. Thanks for your interest in 'flutter_map', and we are happy to answer any more questions! My apologies for the late reply.

JaffaKetchup avatar May 22 '22 20:05 JaffaKetchup

hi,
I'm sorry I can't understand your explanation. How to modify the program? Is there a way to do it? Thank you~

victor0726 avatar May 23 '22 06:05 victor0726

Hi @victor0726, Unfortunately, there is no way to do it right now. I've converted to a feature request so it may be implemented in the future.

JaffaKetchup avatar May 23 '22 06:05 JaffaKetchup

If you want a quick hack, comment out the onLongPress: _positionedTapController.onLongPress lines (probably lines 142 & 152 of lib/src/map/flutter_map_state.dart).

I haven't got time to dig into it further atm, but I guess there could be an option pulled in, so it would look something like...

onLongPress: option.disableLongPress ? null : _positionedTapController.onLongPress,

Or maybe something like...

onLongPress: widget.options.onLongPress == null ? null : _positionedTapController.onLongPress

Just some thoughts.

ibrierley avatar May 23 '22 07:05 ibrierley

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Jun 23 '22 02:06 github-actions[bot]

@ibrierley Should I make a PR for this?

JaffaKetchup avatar Jul 18 '22 09:07 JaffaKetchup

Yes, sorry I haven't had a lot of time of late. Feel free to have a bash!

ibrierley avatar Jul 18 '22 09:07 ibrierley

Actually, after looking around a bit, not sure I like the look of that in there. We need to sort out the gestures and events system instead of putting quick fixes like this in.

JaffaKetchup avatar Jul 18 '22 13:07 JaffaKetchup

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Aug 18 '22 02:08 github-actions[bot]

@victor0726 Can you try the new v3 betas, and see if they fix your problem?

JaffaKetchup avatar Aug 18 '22 06:08 JaffaKetchup

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Sep 18 '22 02:09 github-actions[bot]

@victor0726 Any luck with v3?

JaffaKetchup avatar Sep 18 '22 06:09 JaffaKetchup

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Oct 19 '22 02:10 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Oct 24 '22 02:10 github-actions[bot]