flyTo method
Moves the map camera to a new position with an easing animation.
camera The new camera position Camera.
duration Animation duration in milliseconds.
callback Callback to execute when the animation completes CameraCallback.
Example:
// Fly to position with smooth animation
Point targetPoint = Point(150.0, 250.0);
Camera targetCamera = Camera(targetPoint, 75.0, 45.0, 30.0);
CameraCallback callback = CameraCallback(
onMoveFinished: (completed) {
if (completed) {
print("Fly to animation completed successfully");
} else {
print("Fly to animation was cancelled");
}
},
);
_locationWindow!.flyTo(targetCamera, 2000, callback);
print("Started fly to animation to point (${targetPoint.x}, ${targetPoint.y})");
Implementation
@override
void flyTo(Camera camera, int duration, CameraCallback callback) {
final _flyToFfi = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction<
Void Function(Pointer<Void>, CameraNative, Int32, Pointer<Void>),
void Function(Pointer<Void>, CameraNative, int, Pointer<Void>)
>('navigine_sdk_flutter_LocationWindow_flyTo__Camera_Duration_Callback'));
_flyToFfi(this.ptr, CameraImpl.toNative(camera), duration, CameraCallbackImpl.getNativePtr(callback));
exception.checkCallResult();
}