viewport property
The current viewport of the map view.
Fields Rectangle.left and Rectangle.top are 0 as they are measured from the top left corner of the map view. Fields Rectangle.width and Rectangle.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
Implementation
Rectangle<int> get viewport {
final OperationResult resultString = objectMethod(
_pointerId,
'MapView',
'getViewport',
);
final Rectangle<int> rect = Rectangle<int>(
resultString['result']['x'] ?? 0,
resultString['result']['y'] ?? 0,
resultString['result']['width'] ?? 0,
resultString['result']['height'] ?? 0);
return rect;
}