getSnapshot method

MapSnapshot getSnapshot()

Copies the map's state.

The copy doesn't wait for pending commands. To read the camera after they apply, use MapHandle.getCamera().

See mln_map_get_snapshot in the C API reference.

Errors:

  • Status.invalidState until RuntimeHandle.createMap() completes with Status.ok.

Implementation

MapSnapshot getSnapshot() => withNativeArena((arena) {
  final outSnapshot = arena<raw.mln_map_snapshot>();
  outSnapshot.ref.size = sizeOf<raw.mln_map_snapshot>();
  _check(
    raw.mln_map_get_snapshot(_handle.raw, outSnapshot, nativeDiagnostic),
  );
  return _readMapSnapshot(outSnapshot.ref);
});