latLngsForPixels method
- List<
ScreenPoint> points
Finds the coordinates at several screen points, as
MapProjectionHandle.latLngForPixel() does.
See mln_map_projection_lat_lngs_for_pixels in the
C API reference.
Implementation
List<LatLng> latLngsForPixels(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(
_handle.raw,
nativepoints,
points.length,
outCoordinates,
nativeDiagnostic,
),
);
return List<LatLng>.unmodifiable(
List.generate(
points.length,
(index) => _readLatLng(outCoordinates[index]),
),
);
});