latLngsForPixelsUnwrapped method

List<LatLng> latLngsForPixelsUnwrapped(
  1. List<ScreenPoint> points
)

Finds the coordinates at several screen points, as MapProjectionHandle.latLngForPixelUnwrapped() does.

See mln_map_projection_lat_lngs_for_pixels_unwrapped in the C API reference.

Implementation

List<LatLng> latLngsForPixelsUnwrapped(List<ScreenPoint> points) =>
    withNativeArena((arena) {
      final nativepoints = arena<raw.mln_screen_point>(
        points.isEmpty ? 1 : points.length,
      );
      for (var index = 0; index < points.length; index++) {
        _writeScreenPoint(points[index], arena, into: nativepoints + index);
      }
      final outCoordinates = arena<raw.mln_lat_lng>(
        points.isEmpty ? 1 : points.length,
      );
      _check(
        raw.mln_map_projection_lat_lngs_for_pixels_unwrapped(
          _handle.raw,
          nativepoints,
          points.length,
          outCoordinates,
          nativeDiagnostic,
        ),
      );
      return List<LatLng>.unmodifiable(
        List.generate(
          points.length,
          (index) => _readLatLng(outCoordinates[index]),
        ),
      );
    });