cameraForGeometry method
- Object? geometry, {
- CameraFitOptions? fitOptions,
Computes a camera that fits a GeoJSON geometry in the map's view.
geometry is a GeoJSON geometry object with at least one coordinate, not
a feature. The camera keeps the map's bearing and pitch unless
fitOptions sets them, and its zoom stays within the map's zoom limits.
See mln_map_camera_for_geometry in the
C API reference.
Errors:
Status.invalidArgumentwhen the padding infitOptionsleaves no room for the area.
Implementation
Future<CameraOptions> cameraForGeometry(
Object? geometry, {
CameraFitOptions? fitOptions,
}) => _query(
_resultCameraOptions,
(arena, completion) => raw.mln_map_camera_for_geometry(
_handle.raw,
_nativeJsonView(geometry, arena),
fitOptions == null ? nullptr : _writeCameraFitOptions(fitOptions, arena),
completion,
nativeDiagnostic,
),
);