create static method

MapProjectionHandle create(
  1. MapView view
)

Creates a projection that converts coordinates for one view of a map.

Create it from the view of an MapSnapshot or an RenderFrameResult. The projection doesn't follow the map, so create a new one after the map's camera or size changes.

See mln_map_projection_create in the C API reference.

Implementation

static MapProjectionHandle create(MapView view) => withNativeArena((arena) {
  ensureAbiVersion();
  final outProjection = arena<Uint64>();
  _check(
    raw.mln_map_projection_create(
      _writeMapView(view, arena),
      outProjection,
      nativeDiagnostic,
    ),
  );
  return _adoptOwned(
    outProjection.value,
    () => MapProjectionHandle._(_NativeMapProjection(outProjection.value)),
    (handle) {
      raw.mln_map_projection_release(handle);
    },
  );
});