onDragUpdate method

  1. @override
void onDragUpdate(
  1. Marker item,
  2. LatLng origin,
  3. LatLng current
)
override

Handle drag updates (e.g., debounced position change callbacks).

Implementation

@override
void onDragUpdate(Marker item, LatLng origin, LatLng current) {
  // Logic from MarkerController._emitDragDebounced
  if (item is InteractiveMarker) {
    item.gestureOptions?.onPositionChanged?.call(origin, current);
  }
  // New generic spatial update call
  // Note: This isn't exactly mapping 1:1 to onMarkerPositionChanged(item, origin, current)
  // because generic onSpatialUpdate takes (newEntity, oldEntity).
  // But drag update is transient.
  // The previous onMarkerPositionChanged was: void Function(Marker marker, LatLng oldPoint, LatLng newPoint)? onMarkerPositionChanged;
  // The new one is onSpatialUpdate(T entity, T oldEntity).
  // We cannot construct T oldEntity easily here with just points.
  // However, onDragUpdate is primarily for FEEDBACK during drag, not necessarily committed change.
  // If the user relied on onMarkerPositionChanged for live feedback of the marker point,
  // they might need to inspect the transient state instead or we fire the callback with fabricated entities?
  // BUT, onSpatialUpdate is usually for committed changes or explicit moves?
  // Actually, check options.dart:
  // OnSpatialUpdateCallback<T> = void Function(T entity, T oldEntity);
  // Be careful relying on it for high-frequency drag updates if constructing entities is expensive.

  // For now, we will leave this empty or if critical, we'd need to fetch old entity state from controller/history?
  // But Logic class doesn't have access to controller state.

  // The previous code: editOptions.onMarkerPositionChanged?.call(item, origin, current);
  // 'item' here is the marker being dragged (the transient one potentially or the source one?).
  // Usually source one passed to onDragUpdate.
}