moveTo method
void
moveTo(
- Camera camera,
- int duration,
- AnimationType animationType,
- CameraCallback callback,
override
Moves the map camera to a new position with a smooth pan-and-zoom animation.
camera The new camera position Camera.
duration Animation duration in milliseconds (-1 for default duration).
animationType The type of easing animation AnimationType.
callback Callback to execute when the animation completes CameraCallback.
Example:
// Move to position with linear animation
Point targetPoint = Point(200.0, 300.0);
Camera targetCamera = Camera(targetPoint, 100.0, 90.0, 0.0);
CameraCallback callback = CameraCallback(
onMoveFinished: (completed) {
print("Move to with linear animation ${completed ? 'completed' : 'cancelled'}");
},
);
_locationWindow!.moveTo(targetCamera, 1500, AnimationType.LINEAR, callback);
print("Started move to with linear animation");
Implementation
@override
void moveTo(Camera camera, int duration, AnimationType animationType, CameraCallback callback) {
final _moveToFfi = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction<
Void Function(Pointer<Void>, Pointer<Void>, Int32, Uint32, Pointer<Void>),
void Function(Pointer<Void>, Pointer<Void>, int, int, Pointer<Void>)
>('navigine_sdk_flutter_LocationWindow_moveTo__Camera_Duration_AnimationType_Callback'));
final _cameraHandle = navigine_sdk_flutter_Camera_ToFfi(camera);
final _durationHandle = navigine_sdk_flutter_int_ToFfi(duration);
final _animationTypeHandle = navigine_sdk_flutter_AnimationType_ToFfi(animationType);
final _callbackHandle = navigine_sdk_flutter_CameraCallback_ToFfi(callback);
final _handle = this.handle;
_moveToFfi(_handle, _cameraHandle, _durationHandle, _animationTypeHandle, _callbackHandle);
navigine_sdk_flutter_Camera_ReleaseFfiHandle(_cameraHandle);
navigine_sdk_flutter_int_ReleaseFfiHandle(_durationHandle);
navigine_sdk_flutter_AnimationType_ReleaseFfiHandle(_animationTypeHandle);
navigine_sdk_flutter_CameraCallback_ReleaseFfiHandle(_callbackHandle);
}