setViewpointGeometry method

Future<bool> setViewpointGeometry(
  1. Geometry boundingGeometry, {
  2. double? paddingInDiPs,
})

Zooms and pans the map view to the extent of the provided geometry with additional padding.

Parameters:

  • boundingGeometry — The geometry to zoom to.
  • paddingInDiPs — The minimum amount of padding around the bounding geometry in pixels.

Return Value: A Future.

Implementation

Future<bool> setViewpointGeometry(
  Geometry boundingGeometry, {
  double? paddingInDiPs,
}) {
  final taskHandle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_MapView_setViewpointGeometryCombined(
      _handle,
      boundingGeometry._handle,
      paddingInDiPs,
      errorHandler,
    );
  });
  return taskHandle.toFuture(
    (element) => element.getValueAsBool()!,
  );
}