@@ -40,6 +40,12 @@ typedef PointerHoverCallback = void Function(
4040 LatLng point,
4141);
4242
43+ /// Callback to notify when the map registers a pointer move event.
44+ typedef PointerMoveCallback = void Function (
45+ PointerMoveEvent event,
46+ LatLng point,
47+ );
48+
4349/// Callback that gets called when the viewport of the map changes.
4450///
4551/// {@macro map_position.has_gesture}
@@ -109,6 +115,16 @@ class MapOptions {
109115 /// down (e.g. mouse pointers, but not most touch pointers)
110116 final PointerHoverCallback ? onPointerHover;
111117
118+ /// Called when a pointer is down and moves.
119+ ///
120+ /// If used while dragging the map, this may emit the same point as by
121+ /// [onPositionChanged] , but might not due to map pixel snapping or a slight
122+ /// delay, or any other disconnect between the pointer and map camera.
123+ ///
124+ /// Prefer using [onPositionChanged] , unless this is specifically required,
125+ /// such as obtaining the pointer position while the map camera is 'locked'.
126+ final PointerMoveCallback ? onPointerMove;
127+
112128 /// This callback fires when the [MapCamera] data has changed. This gets
113129 /// called if the zoom level, or map center changes.
114130 final PositionCallback ? onPositionChanged;
@@ -158,6 +174,7 @@ class MapOptions {
158174 this .onPointerUp,
159175 this .onPointerCancel,
160176 this .onPointerHover,
177+ this .onPointerMove,
161178 this .onPositionChanged,
162179 this .onMapEvent,
163180 this .onMapReady,
0 commit comments