Skip to content

Conversation

ReinisSprogis
Copy link
Contributor

I needed a onPointerMove functionality but there was only onPointerHover. For example when I want to drag graphics on map, I disable map pan onTapDown and can use onPointerMove to reposition graphics. This cannot be done with onPointerHover as it does not respond when tap is also down. There already was an _onPointerMove method just not exposed to user. Any reason not to do this?

@JaffaKetchup
Copy link
Member

Hey @ReinisSprogis, just wondering why one of the existing movement listeners wouldn't work?

The MapOptions.onPositionChanged callback has an argument which is set if the movement was gesture initiated (instead of controller initiated), if that's what you're looking for: https://pub.dev/documentation/flutter_map/latest/flutter_map/PositionCallback.html.

@ReinisSprogis
Copy link
Contributor Author

Hi @JaffaKetchup onPositionChanged does not work, because position of MapCamera does not change when map pan is disabled. Needed to get a pointer position as LatLng when tapping down and moving pointer. If interactionOptions: InteractionOptions(flags: InteractiveFlag.none) onPositionChanged does not callback.
An example of usage would be to make draggable graphics. When a user taps on marker, I disable map gestures and allow user to drag a marker (or whatever graphics). Without disabling map gestures map drags together with marker, but if disabled, no other gestures provide LatLng point if pointer is down and dragging.

@JaffaKetchup JaffaKetchup requested a review from a team August 26, 2025 16:48
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

Successfully merging this pull request may close these issues.

2 participants