viewport property

RectType<int> get viewport

The current viewport of the map view.

Fields RectType.x and RectType.y are 0 as they are measured from the top left corner of the map view. Fields RectType.width and RectType.height are the width and height of the map view in physical pixels.

Use the transformScreenToWgsRect to get the associated RectangleGeographicArea.

Returns

  • The current viewport

Throws

  • An exception if it fails.

Implementation

RectType<int> get viewport {
  final OperationResult resultString = objectMethod(
    _pointerId,
    'MapView',
    'getViewport',
  );

  return RectType<int>.fromJson(resultString['result']);
}